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

   **What**
   
   - Speed up `BoundSetPredicate.Literals()` copies.
   
   **Why**
   
   - Large `IN` and `NOT IN` sets build a temporary slice and grow the copy map 
many times.
   - The 8,192-value integer case uses 54% fewer allocated bytes and is 2.1x 
faster locally.
   
   Apple M1 Pro, Go 1.26.3, one CPU, medians of 7 x 1s runs:
   
   | Set | Time/op before -> after | B/op before -> after | Allocs/op before -> 
after |
   |---|---:|---:|---:|
   | int32/2 | 284.9 -> 247.6 ns | 368 -> 352 | 3 -> 3 |
   | int32/8 | 535.4 -> 446.5 ns | 464 -> 352 | 3 -> 3 |
   | int32/64 | 9.1 -> 3.9 us | 10,520 -> 4,968 | 12 -> 5 |
   | int32/1024 | 151.9 -> 71.6 us | 178,760 -> 82,064 | 23 -> 7 |
   | int32/8192 | 1,194.3 -> 557.5 us | 1,439,400 -> 656,064 | 82 -> 35 |
   | binary/2 | 470.5 -> 518.6 ns | 512 -> 496 | 11 -> 11 |
   | binary/8 | 1.3 -> 1.3 us | 1,040 -> 928 | 35 -> 35 |
   | binary/64 | 14.7 -> 10.8 us | 15,128 -> 9,576 | 268 -> 261 |
   | binary/1024 | 243.2 -> 177.4 us | 252,488 -> 155,792 | 4,119 -> 4,103 |
   | binary/8192 | 2,304.8 -> 1,551.9 us | 2,029,225 -> 1,245,888 | 32,850 -> 
32,803 |
   
   Small binary timing differences are not significant in this run (p > 0.05).
   
   **Implementation**
   
   - Size the copy map from the literal count.
   - Iterate with `All()` and keep the existing copies of mutable values.
   
   Benchmark: `go test . -run '^$' -bench 
'^BenchmarkBoundSetPredicateLiterals$' -benchmem -benchtime=1s -count=7 -cpu=1`.
   
   Base: `0b0828bffd8ba7f50e18cbafa59d6a4b8e5df2f6`.
   Head: `5313205542577055bf5e0954c1b74bc80b338c9b`.
   


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