fallintoplace opened a new pull request, #2263: URL: https://github.com/apache/iceberg-go/pull/2263
## What Calculate year and month partition values directly from Unix days. ## Why Avoid converting each Date, Timestamp, and TimestampNs value to `time.Time`. ## Implementation - Convert days with Gregorian 400-year eras and keep floor-day handling for negative timestamps. - Add parity coverage for pre-epoch and extreme values, plus paired benchmarks. ## Benchmark Paired old `time.Time` and new Unix-day implementations in one process. Go 1.26.3, Apple M1 Pro (`darwin/arm64`), `GOMAXPROCS=1`; 10 runs of 300 ms per case. | Metric | Before | After | Change | | --- | ---: | ---: | ---: | | Date year | 30.895 ns/op | 8.663 ns/op | -71.96% | | Date month | 41.665 ns/op | 9.049 ns/op | -78.28% | | Timestamp year | 15.040 ns/op | 9.691 ns/op | -35.56% | | Timestamp month | 28.34 ns/op | 10.22 ns/op | -63.93% | | TimestampNs year | 16.100 ns/op | 9.655 ns/op | -40.03% | | TimestampNs month | 26.03 ns/op | 10.21 ns/op | -60.77% | | Geometric mean, 6 cases | 24.75 ns/op | 9.564 ns/op | -61.36% | All six cases improved. Both implementations use 0 B/op and 0 allocs/op. Command: `GOMAXPROCS=1 go test . -run '^$' -bench '^BenchmarkCalendarPartitionTransform$' -benchmem -benchtime=300ms -count=10 -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]
