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

   ## What
   
   Make large batches of schema field moves linear in the number of fields and 
moves.
   
   ## Why
   
   Repeated scans and slice copies make large schema reorders slow and 
allocation-heavy.
   
   ## Implementation
   
   - Keep the existing path for small updates.
   - Index field IDs and relink positions for larger updates, then build the 
result once.
   - Preserve existing fallback and panic behavior. Add equivalence cases and a 
package benchmark.
   
   ## Benchmark
   
   `go test ./table -run '^$' -bench '^BenchmarkMoveFieldsBulkReorder$' 
-benchmem -benchtime=300ms -count=7`
   
   Go 1.26.3, darwin/arm64, Apple M1 Pro. Seven samples. Base 
`a4fb4d0dafaeaf455990c1c3142462107662e5ec`, head 
`f36c33ce31d88f86f1e4a4fce189109acc74a110`. This package microbenchmark 
compares the original linear implementation with the indexed implementation; it 
measures field moves, not full schema updates.
   
   | Workload | Linear → indexed | Speedup | B/op | Allocs/op |
   | --- | ---: | ---: | ---: | ---: |
   | 64 fields, 8 moves | 11.19 → 2.671 µs | 4.2× | 58.12 → 9.664 KiB | 17 → 5 |
   | 256 fields, 64 moves | 300.8 → 10.13 µs | 29.7× | 1.696 MiB → 39.91 KiB | 
129 → 5 |
   | 1,024 fields, 1,024 moves | 16.46 ms → 45.93 µs | 358× | 96.19 MiB → 148.1 
KiB | 2,050 → 7 |
   | 4,096 fields, 4,096 moves | 256.6 ms → 188.5 µs | 1,362× | 1.501 GiB → 
592.3 KiB | 8,205 → 19 |
   | 256 fields, 64 mixed moves | 312.9 → 10.65 µs | 29.4× | 1.174 MiB → 39.91 
KiB | 87 → 5 |
   | 1,024 fields, 1,024 mixed moves | 17.61 ms → 52.96 µs | 333× | 66.52 MiB → 
148.1 KiB | 1,368 → 7 |
   
   Small updates continue to use the existing linear path.
   


-- 
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