fallintoplace opened a new pull request, #1327: URL: https://github.com/apache/arrow-go/pull/1327
### What - Speed up `Equal` and `ApproxEqual` when one array has no validity bitmap. ### Why - Comparing an absent bitmap with a materialized bitmap currently checks validity one row at a time. ### Implementation - Use `CountSetBits` on the present bitmap, respecting its slice offset. - Preserve empty-buffer handling and bitmap checks when declared null counts are inconsistent. ### Benchmark Apple M1 Pro, Go 1.26.3, `GOMAXPROCS=1`. Medians of six alternating before/after runs, 300 ms per case. Each case below compares 1,048,576 values with one absent bitmap and one materialized bitmap. Binary/string values are 8 bytes each. | Case | Before | After | Speedup | | --- | ---: | ---: | ---: | | Boolean, Equal | 8,806.5 µs | 21.3 µs | 414.4x | | Boolean, ApproxEqual | 4,643.2 µs | 20.9 µs | 221.9x | | Int8, Equal | 5,868.4 µs | 58.9 µs | 99.6x | | Int64, Equal | 7,586.4 µs | 494.7 µs | 15.3x | | Binary, Equal | 11,979.7 µs | 1,658.2 µs | 7.2x | | String, Equal | 8,959.1 µs | 1,895.6 µs | 4.7x | | String, ApproxEqual | 19,381.8 µs | 11,087.5 µs | 1.7x | No new allocations. The benchmark also covers 64-value arrays, unaligned slices, and controls with both bitmaps present or both absent. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
