fallintoplace opened a new pull request, #2029: URL: https://github.com/apache/iceberg-go/pull/2029
## What Avoid rebuilding the partition Avro schema on DataFile schema-cache hits. ## Why Every encode and decode currently builds and stringifies the partition schema before checking the cache. Repeated files with the same partition shape pay this cost again. ## Implementation - Build the key from ordered partition field IDs, names, and resolved result types. - Keep format versions separate. Ignore docs and table-local schema/spec IDs. - Build the Avro schema and field maps only on a cache miss. ## Benchmark Warm cache, Apple M1 Pro, Go 1.26.3. Medians from alternating before/after runs: 10 for MarshalAvroEntry, 6 for the other cases. Benchmarks cover unpartitioned, identity, and mixed partitions across v1–v3. Timings vary on the shared local machine; allocation counts are stable. | Benchmark | Before, µs/op | After, µs/op | Allocs/op before → after | | --- | ---: | ---: | ---: | | Existing MarshalAvroEntry/v1 | 53.22 | 8.84 | 144 → 13 | | Existing MarshalAvroEntry/v2 | 51.78 | 7.90 | 144 → 13 | | Existing MarshalAvroEntry/v3 | 51.18 | 7.91 | 144 → 13 | | Unpartitioned lookup, v2 | 17.20 | 0.16 | 54 → 0 | | Mixed 4-field lookup, v2 | 190.20 | 3.19 | 425 → 6 | | Mixed 4-field marshal, v2 | 225.01 | 14.14 | 439 → 20 | | Mixed 4-field unmarshal, v2 | 169.19 | 17.84 | 465 → 46 | -- 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]
