fallintoplace opened a new pull request, #1231:
URL: https://github.com/apache/arrow-go/pull/1231

   ## What
   
   - Reuse a `[]bool` scratch buffer in `PutSpaced` for Plain and RLE boolean 
encoders.
   - Reuse the same scratch for RLE `PutSpacedBitmap` writes.
   - Keep the scratch capacity across repeated page writes.
   
   ## Benchmark
   
   Apple M1 Pro, Go 1.26.3. The same encoder is reused, and scratch growth 
happens before the timed loop.
   
   Command: `go test -vet=off ./parquet/internal/encoding -run "^$" -bench 
"^Benchmark(Plain|Rle)BooleanEncoderPutSpaced$" -benchmem -benchtime=300ms 
-count=3 -cpu=1`
   
   All-valid input, before vs after:
   
   | Encoder | Values | Before | After |
   | --- | ---: | ---: | ---: |
   | Plain | 1,024 | 1,024 B/op, 1 alloc | 0 B/op, 0 allocs |
   | Plain | 65,536 | 65,539 B/op, 1 alloc | 0 B/op, 0 allocs |
   | Plain | 1,048,576 | 1,048,620 B/op, 1 alloc | 0 B/op, 0 allocs |
   | RLE | 1,024 | 1,232 B/op, 4 allocs | 208 B/op, 3 allocs |
   | RLE | 65,536 | 65,747 B/op, 4 allocs | 208 B/op, 3 allocs |
   
   ## Tests
   
   - `go test ./parquet/internal/encoding -count=1`
   - `PARQUET_TEST_DATA=parquet-testing/data go test ./... -count=1`


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