fallintoplace opened a new pull request, #1930: URL: https://github.com/apache/iceberg-go/pull/1930
## What - Build a set of requested IDs once in `RemovePartitionSpecs` and `RemoveSchemas`. - Reuse it for protected-ID validation and list filtering. - Keep removal order, update payloads, and no-op behavior unchanged. - Add coverage for duplicates, requested-order differences, and atomic validation errors. - Add benchmarks for small and historical metadata workloads. ## Why Both methods used `slices.Contains` for every stored schema or partition spec. For `n` stored entries and `k` requested IDs, that makes the membership work O(n*k). ## Benchmark Apple M1 Pro. Median of 3 runs: ```text go test ./table -run '^$' -bench '^BenchmarkRemove(PartitionSpecs|Schemas)$' -benchmem -count=3 -benchtime=50ms ``` | Workload | Before | After | Speedup | | --- | ---: | ---: | ---: | | Partition specs 128/64 | 4.65 us/op | 3.02 us/op | 1.5x | | Partition specs 1,024/512 | 168 us/op | 21.0 us/op | 8.0x | | Partition specs 8,192/4,096 | 8.69 ms/op | 183 us/op | 47x | | Schemas 128/64 | 4.17 us/op | 3.52 us/op | 1.2x | | Schemas 1,024/512 | 163 us/op | 18.6 us/op | 8.7x | | Schemas 8,192/4,096 | 8.33 ms/op | 140 us/op | 60x | The indexed path uses extra memory for the ID set, in exchange for avoiding repeated linear scans. The one-entry cases are not the target workload. ## Tests - `go test ./table -count=1` - `go vet ./table` -- 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]
