fallintoplace opened a new pull request, #1910:
URL: https://github.com/apache/iceberg-go/pull/1910

   ## Summary
   
   - **Adds an ID to position index for partition specs.**
   - Uses it for metadata `PartitionSpecByID`, default `PartitionSpec`, and 
builder `GetSpecByID`.
   - Keeps the existing defensive-copy behavior.
   - Updates the index on add/remove and uses copy-on-write for builder clones.
   - Includes fallback coverage for stale in-package slices and read-only 
concurrent lookups.
   
   ## Benchmark
   
   Command:
   
   `go test ./table -run ^$ -bench 
^(BenchmarkPartitionSpecByID|BenchmarkMetadataBuilderGetSpecByID)$ -benchmem 
-benchtime=200ms -count=5`
   
   Median of 5 runs on Apple M1 Pro:
   
   | Workload | Before | After |
   | --- | ---: | ---: |
   | Metadata, 2,048 specs, last hit | 2,528 ns/op | 84 ns/op |
   | Metadata, 2,048 specs, miss | 2,443 ns/op | 8.34 ns/op |
   | Builder, 2,048 specs, last hit | 54.9 us, 98,304 B/op, 2,048 allocs/op | 
33.8 ns/op, 48 B/op, 1 alloc/op |
   | Builder, 2,048 specs, miss | 56.5 us, 98,403 B/op, 2,051 allocs/op | 138 
ns/op, 72 B/op, 3 allocs/op |
   
   The metadata path still clones the returned spec. Builder misses still 
format the existing error. The lookup itself is now constant time.
   
   ## Checks
   
   - `go test ./table -count=1 -timeout=5m`
   - `go test ./table -race -run 
^(TestCommonMetadataPartitionSpecIndex|TestParsedMetadataBuildsPartitionSpecIndex|TestMetadataBuilderPartitionSpecIndex|TestMetadataBuilderRemoveUnknownPartitionSpec|TestCommonMetadataPartitionSpecLookupsConcurrent|TestMetadataBuilderPartitionSpecLookupsConcurrent)$
 -count=1`
   - `go test ./... -run ^$ -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]

Reply via email to