You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "fallintoplace (via GitHub)" <gi...@apache.org> on 2026/08/27 13:22:09 UTC

[PR] perf(parquet): reuse fixed-length zero scratch [arrow-go]

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

   ## Summary
   
   - Reuse a zero-value buffer in `PlainFixedLenByteArrayEncoder`.
   - Allocate it lazily only when `Put` sees a nil value.
   - Clear the buffer reference when the encoder is released.
   - Add coverage for lazy creation and reuse.
   - Add benchmarks for widths 4, 16, and 32 with repeated small `Put` calls.
   
   ## Benchmark
   
   Apple M1 Pro. Median of 3 runs. All-valid input.
   
   | width | rows per put | puts | upstream main | this PR | change |
   | ---: | ---: | ---: | ---: | ---: | ---: |
   | 4 | 1 | 64 | 489 ns | 470 ns | -4% |
   | 16 | 1 | 64 | 516 ns | 470 ns | -9% |
   | 32 | 1 | 64 | 498 ns | 471 ns | -5% |
   
   The benchmark also covers 1, 16, and 1024 rows with 1, 64, and 1024 repeated puts, plus sparse nil input.
   
   ```text
   go test ./parquet/internal/encoding -run '^$' -bench 'BenchmarkPlainEncodingFixedLenByteArray' -benchmem -benchtime=100ms -count=3
   ```
   
   ## Tests
   
   - `go test ./parquet/internal/encoding -count=1`
   - `PARQUET_TEST_DATA=/path/to/parquet-testing/data go test ./parquet/file ./parquet/pqarrow -count=1`
   - `PARQUET_TEST_DATA=/path/to/parquet-testing/data go test -race ./parquet/internal/encoding ./parquet/file ./parquet/pqarrow -count=1`
   - `go vet ./parquet/internal/encoding ./parquet/file ./parquet/pqarrow`
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] perf(parquet): reuse fixed-length zero scratch [arrow-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade merged PR #1236:
URL: https://github.com/apache/arrow-go/pull/1236


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org