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

   ## What
   Speed up `UpdateNameMapping` for wide schemas.
   
   ## Why
   Large mappings create many temporary slices and field ID allocations.
   
   ## Implementation
   - Build each sibling level in one pass.
   - Keep copied field IDs in one owned slice.
   - Reuse fresh slices when aliases or fields move.
   - Preserve independent results and existing mapping behavior.
   
   ## Benchmark
   Go 1.26.3, Apple M1 Pro, `GOMAXPROCS=1`; 10 runs of 300 ms. Same benchmark 
file at base and head. Base: `a4fb4d0`; head: `13e98d2`.
   
   | Metric | Before | After | Change |
   | --- | ---: | ---: | ---: |
   | 4,096 fields, no updates | 873.8 µs | 404.0 µs | -53.8% |
   | 4,096 fields, rename reused | 930.3 µs | 492.4 µs | -47.1% |
   | 4,096 fields, add reused | 1,341.9 µs | 698.9 µs | -47.9% |
   | 4,096 fields, bytes/op (no updates) | 1,127.8 KiB | 384.0 KiB | -66.0% |
   | 4,096 fields, allocs/op (no updates) | 8,209 | 4,098 | -50.1% |
   
   At 2 fields, reused rename was 7.6% faster, but bytes/op increased by 64 B 
(448 to 512 B).
   
   Command: `GOMAXPROCS=1 go test . -run '^$' -bench 
'^BenchmarkUpdateNameMapping/(no-updates|rename-reused|add-reused)/(4096|2)$' 
-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]

Reply via email to