fallintoplace opened a new pull request, #2121: URL: https://github.com/apache/iceberg-go/pull/2121
## What - Build `PartitionType` fields in one pass. ## Why - Avoid a temporary slice on each call. - This is used by scan evaluators, manifest writers and metadata tables. ## Implementation - Allocate the final fields once and resolve source types directly. - Keep field order, optional fields and missing-source handling. ## Performance Go 1.26.3, darwin/arm64, Apple M1 Pro. Base `fa5309b`; PR `272ca0f`. 7 samples per side, alternating base/PR order. Repeated calls with warm schema indexes. | Case | Base ns/op | PR ns/op | B/op, base → PR | allocs/op, base → PR | | --- | ---: | ---: | ---: | ---: | | 0 fields (control) | 119.1 | 109.0 | 24 → 24 | 1 → 1 | | 1 fields | 548.7 | 364.9 | 216 → 120 | 3 → 2 | | 3 fields | 1,131.0 | 1,103.0 | 600 → 312 | 3 → 2 | | 20 fields | 6,898.0 | 5,909.0 | 4,120 → 2,072 | 3 → 2 | | 100 fields (stress) | 46,178.0 | 29,330.0 | 19,480 → 9,752 | 3 → 2 | | 2 fields, 10 schemas | 905.3 | 549.3 | 408 → 216 | 3 → 2 | **44–50% fewer allocated bytes** for nonempty specs. Allocation results were identical across all 7 samples. Timings are local medians and varied between runs. Reproduce on both revisions with the same benchmark file: ```sh GOMAXPROCS=1 go test . -run '^$' -bench '^BenchmarkPartitionType(FieldCount|MultipleSchemas)$' -benchmem -benchtime=1s -count=7 -cpu=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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
