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

   ## Summary
   
   - Keep one `recordEncoder` on `Writer` and `FileWriter`.
   - Reuse the `fields`, `meta`, and `variadicCounts` backing arrays.
   - Restore the encoder recursion depth when resetting.
   - Add a benchmark for repeated writes with 1, 16, and 64 columns.
   - Add a regression test for resetting after a nested encode error.
   
   ## Benchmark
   
   **Command**
   
   ```text
   go test ./arrow/ipc -run '^$' -bench '^BenchmarkWriterRecordEncoderReuse$' 
-benchmem -benchtime=100ms -count=3
   ```
   
   **Machine:** Apple M1 Pro, arm64  
   **Go:** 1.26.3
   
   The benchmark writes one warm-up batch before timing repeated writes. Each 
width was tested with 16, 256, and 4096 rows. The allocation results were the 
same across those row counts.
   
   | Columns | Before | After |
   | --- | ---: | ---: |
   | 1 | 1,624 B/op, 21 allocs/op | 1,408 B/op, 18 allocs/op |
   | 16 | 8,072 B/op, 33 allocs/op | 6,656 B/op, 26 allocs/op |
   | 64 | 31,240 B/op, 41 allocs/op | 25,984 B/op, 32 allocs/op |
   
   Timing was noisy on this machine, so the allocation reduction is the main 
result.
   
   ## Tests
   
   - `go test ./arrow/ipc`
   - `go test ./arrow/...`
   


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