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

   ## Summary
   
   - Reserve the output payload buffer after the existing `BinaryView` scan 
computes the total payload size.
   - Keep the existing overflow check and append path unchanged.
   - Add a benchmark for 64K values with 4, 32, and 256 byte payloads, plus 0%, 
10%, and 50% nulls.
   
   This avoids repeated growth copies when materializing out-of-line 
`BinaryView` values as `Binary`.
   
   ## Benchmark
   
   Measured on Apple M1 Pro, macOS arm64, Go 1.26.3. Median of 3 runs. Each 
result is `time/op`, `B/op`, and `allocs/op`.
   
   | Payload | Nulls | Before | After |
   | --- | ---: | --- | --- |
   | 4 B | 0% | 1.46 ms, 1.12 MB, 66 allocs | 1.41 ms, 0.82 MB, 54 allocs |
   | 32 B | 0% | 1.96 ms, 4.81 MB, 70 allocs | 1.69 ms, 2.66 MB, 54 allocs |
   | 256 B | 0% | 4.20 ms, 34.2 MB, 71 allocs | 2.93 ms, 17.3 MB, 55 allocs |
   | 256 B | 50% | 2.55 ms, 17.4 MB, 70 allocs | 1.87 ms, 8.95 MB, 55 allocs |
   
   The benchmark matrix also covers 10% nulls. The samples reduce payload 
allocation by 26% to 54% and remove 12 to 16 allocations per operation.
   
   Command:
   
   ```text
   go test -vet=off ./arrow/compute -run ^ -bench 
^BenchmarkBinaryViewToBinaryMaterialization -benchmem -benchtime=500ms -count=3 
-cpu=1
   ```
   
   ## Tests
   
   - `go test ./arrow/compute ./arrow/compute/internal/kernels -count=1`
   - `go test ./... -count=1` with the pinned `arrow-testing` and 
`parquet-testing` submodules initialized


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