fallintoplace opened a new pull request, #1223: URL: https://github.com/apache/arrow-go/pull/1223
## What does this change? - `AppendEmptyValues` used to build an `n`-element values array and dictionary-encode every empty value. - Resolve the empty value once, reserve the index builder once, and append the same dictionary index for the whole batch. - Keep the existing null dictionary path unchanged. ## Benchmark Command: ```text go test ./arrow/array -run '^$' -bench '^BenchmarkDictionaryBuilderAppendEmptyValues$' -benchmem -benchtime=200ms -count=3 ``` Apple M1 Pro, Go 1.26.3. The benchmark reuses the dictionary builder and resets the output length between iterations. | Type | Count | Before ns/op | After ns/op | Before B/op | After B/op | | --- | ---: | ---: | ---: | ---: | ---: | | int32 | 64 | 1,684 | 653 | 1,168 | 784 | | int32 | 4,096 | 81,910 | 14,193 | 42,576 | 784 | | int32 | 65,536 | 1,305,061 | 221,358 | 551,382 | 784 | | string | 64 | 2,573 | 868 | 1,568 | 1,056 | | string | 4,096 | 121,191 | 14,577 | 42,912 | 1,056 | | string | 65,536 | 1,916,937 | 230,499 | 551,714 | 1,056 | ## Tests - `go test ./arrow/array -count=1` - `go test ./arrow/... ./internal/...` -- 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]
