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/10/07 10:32:23 UTC

[PR] perf(view): pre-size metadata indexes [iceberg-go]

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

   **What**
   - Pre-size view metadata indexes.
   
   **Why**
   - The slice length is known. A capacity hint avoids map growth while adding entries.
   
   **Implementation**
   - Use `make(map[K]T, len(s))` in `indexBy`.
   - Add a focused benchmark for 1, 10, 32 and 128 entries.
   
   **Benchmark**
   Apple M1 Pro, darwin/arm64, Go 1.26.3. Median of 5 runs, 300ms each, `-cpu=1`. Measures the `indexBy` helper with integer keys and one-field values. The default view version history size is 10.
   
   | Entries | Before ns/op | After ns/op | B/op before → after | Allocs/op before → after |
   | --- | ---: | ---: | ---: | ---: |
   | 1 | 127.4 | 123.9 | 192 → 192 | 2 → 2 |
   | 10 | 471.6 | 319.2 | 520 → 376 | 5 → 4 |
   | 32 | 2070 | 849 | 2312 → 1240 | 9 → 4 |
   | 128 | 8150 | 3318 | 9544 → 4952 | 13 → 4 |
   
   ```sh
   go test ./view -run '^$' -bench '^BenchmarkIndexBy$' -benchmem -benchtime=300ms -count=5 -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: 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(view): pre-size metadata indexes [iceberg-go]

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


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