You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "fallintoplace (via GitHub)" <gi...@apache.org> on 2026/08/28 08:36:11 UTC

[PR] perf(table): avoid redundant MetadataBuilderFromBase copies [iceberg-go]

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

   ## What changed
   
   - Added a small internal fast path for Iceberg's built-in metadata types.
   - The builder now copies schemas, partition specs, snapshots, sort orders, properties, refs, statistics, partition statistics, and encryption keys directly from the internal representation.
   - Custom `Metadata` implementations keep the existing getter path.
   - Added ownership tests for nested mutable values.
   - Added a benchmark for different metadata collection sizes.
   
   ## Why
   
   The built-in metadata getters already clone their values. `MetadataBuilderFromBase` then cloned those results again. This removes that extra copy while keeping the builder's collections independent from the base metadata.
   
   ## Benchmark
   
   Apple M1 Pro. Before is `upstream/main`. After is this branch. Values are the median of the runs.
   
   | snapshots | before ns/op | after ns/op | before B/op | after B/op | before allocs/op | after allocs/op |
   | --- | ---: | ---: | ---: | ---: | ---: | ---: |
   | 1,000 | 85,891 | 54,680 | 305,097 | 162,704 | 86 | 37 |
   | 10,000 | 754,786 | 471,937 | 3,066,366 | 1,502,658 | 121 | 65 |
   
   Command:
   
   ```text
   go test ./table -run ^ -bench ^BenchmarkMetadataBuilderFromBase -benchmem -count=5
   ```
   
   The new `BenchmarkMetadataBuilderFromBaseCollections` also covers 1, 16, 128, and 1,024 schemas; 1, 16, and 128 partition specs; 1,000 snapshots; 32 sort orders; and properties.
   
   ## Checks
   
   - `go test ./...`
   - `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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] perf(table): avoid redundant MetadataBuilderFromBase copies [iceberg-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade merged PR #1932:
URL: https://github.com/apache/iceberg-go/pull/1932


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org