You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This CL implements the ability to slice a given array.Interface,
i.e. the Go equivalent of:
```
vs := []float64{1, 2, 3, 4}
sub := vs[1:3]
```
also, to support sub-slicing, offsets' support had to be implemented inside the `array.Data` and nullbitmap types.
namely, the `arrow/internal/bitutil.CountSetBits` function had to be modified to support counting bits from an arbitrary offset.
this resulted in a minor (?) speed-bump:
```
name old time/op new time/op delta
CountSetBits_3-8 8.16ns ± 1% 8.18ns ± 0% +0.31% (p=0.000 n=19+18)
CountSetBits_32-8 7.62ns ± 1% 7.79ns ± 1% +2.24% (p=0.000 n=18+18)
CountSetBits_128-8 6.80ns ± 1% 7.03ns ± 1% +3.40% (p=0.000 n=18+19)
CountSetBits_1000-8 18.7ns ± 0% 17.8ns ± 1% -4.92% (p=0.000 n=16+20)
CountSetBits_1024-8 16.1ns ± 0% 16.1ns ± 1% +0.44% (p=0.000 n=20+20)
name old alloc/op new alloc/op delta
CountSetBits_3-8 0.00B 0.00B ~ (all equal)
CountSetBits_32-8 0.00B 0.00B ~ (all equal)
CountSetBits_128-8 0.00B 0.00B ~ (all equal)
CountSetBits_1000-8 0.00B 0.00B ~ (all equal)
CountSetBits_1024-8 0.00B 0.00B ~ (all equal)
name old allocs/op new allocs/op delta
CountSetBits_3-8 0.00 0.00 ~ (all equal)
CountSetBits_32-8 0.00 0.00 ~ (all equal)
CountSetBits_128-8 0.00 0.00 ~ (all equal)
CountSetBits_1000-8 0.00 0.00 ~ (all equal)
CountSetBits_1024-8 0.00 0.00 ~ (all equal)
```
I believe some of that speed bump could be recoup'd (see `FIXME` in `go/arrow/internal/bitutil/bitutil.go`)
@stuartcarnie PTAL.
needs apache#2412.
Author: Sebastien Binet <binet@cern.ch>
Closesapache#2419 from sbinet/issue-3036 and squashes the following commits:
547c609 <Sebastien Binet> ARROW-3036: implement array.NewSlice
767c281 <Sebastien Binet> add support for nullbitmap with offset
cb6cdbb <Sebastien Binet> consolidate List array
0 commit comments