tom-eon opened a new pull request, #1090:
URL: https://github.com/apache/arrow-go/pull/1090

   ### What changes are included in this PR?
   
   Adds `bitutil.SetBitSwap` and `bitutil.ClearBitSwap`, which modify a bit and
   return its previous value in a single read-modify-write, and uses
   `ClearBitSwap` in `builder.SetNull` to replace the previous
   `BitIsSet` + `ClearBit` sequence (two byte loads and two `Bytes()` calls).
   
   This makes `SetNull` ~32% faster (1.048ns → 0.716ns, benchstat n=10, Apple 
M4 Pro).
   
   ### Are these changes tested?
   
   Yes. New unit tests `TestSetBitSwap`/`TestClearBitSwap` cover the added
   functions, and the existing `TestBuilder_SetNull` (including idempotency)
   covers the `SetNull` change.
   
   ### Are there any user-facing changes?
   
   Two new exported functions in `bitutil`: `SetBitSwap` and `ClearBitSwap`.
   No behavior changes to existing APIs.


-- 
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]

Reply via email to