fallintoplace opened a new pull request, #2120: URL: https://github.com/apache/iceberg-go/pull/2120
## What - Reuse snapshot history when inspecting partitions. ## Why - `Snapshots()` deep-copies the full history. - The first copy was used only for `len()` and then discarded. ## Implementation - Read snapshots once and reuse the slice for the timestamp map. - Add coverage for historical timestamps and tables without a snapshot. **Benchmarks:** public `Partitions` call, one live data file, in-memory IO and a warm manifest-list cache. Snapshots have parent/schema IDs and summary properties. | Snapshots | ns/op, base → head | B/op, base → head | allocs/op, base → head | | ---: | ---: | ---: | ---: | | 1 | 318,386 → 323,524 | 315,044 → 314,572 | 2,690 → 2,685 | | 100 | 408,923 → 365,197 | 413,250 → 364,767 | 3,683 → 3,183 | | 1,000 | 1,102,131 → 755,914 | 1,315,938 → 833,412 | 12,686 → 7,685 | **31% less time and 39% fewer allocations** with 1,000 snapshots. The one-snapshot control is effectively unchanged. Go 1.26.3, darwin/arm64, Apple M1 Pro. Medians of 7 one-second samples, CPU=1. Base `fa5309b3624d5798bde69722b279366bb7f39846`, head `c901459286d852bda1bc46917b3cf33f5ebf8fdb`. Same benchmark file on both revisions. ```sh go test -p 2 ./table -run '^$' -bench '^BenchmarkInspectPartitionsSnapshotHistory$' -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]
