iverase opened a new pull request, #16178:
URL: https://github.com/apache/lucene/pull/16178

   We are currently using an intermediate buffer to collect those hits but it 
feels more natural to use the method DocIdStream#forEach to collect those. I 
actually asked an AI agent to check the performance of this change and it 
claims this way of collecting hits is faster, even when polluting the consumer 
with different implementations.
   
   Here are the summary of the results:
   
   ```
   Results (polymorphic consumer)
   
     
┌────────┬─────────┬─────────────┬───────────┬─────────┬───────────────────┐
     │ Stream │ Density │ Target      │ intoArray │ forEach │ forEach advantage 
│
     
├────────┼─────────┼─────────────┼───────────┼─────────┼───────────────────┤
     │ BITSET │ 1%      │ FixedBitSet │ 20.1 µs   │ 5.1 µs  │ ~4.0×             
│
     │ BITSET │ 10%     │ FixedBitSet │ 177 µs    │ 33 µs   │ ~5.3×             
│
     │ BITSET │ 50%     │ FixedBitSet │ 914 µs    │ 147 µs  │ ~6.2×             
│
     │ BITSET │ 1%      │ Roaring     │ 19.2 µs   │ 5.4 µs  │ ~3.6×             
│
     │ BITSET │ 10%     │ Roaring     │ 212 µs    │ 48 µs   │ ~4.4×             
│
     │ BITSET │ 50%     │ Roaring     │ 982 µs    │ 202 µs  │ ~4.9×             
│
     │ RANGE  │ 1%      │ FixedBitSet │ 3.0 µs    │ 2.6 µs  │ ~1.2×             
│
     │ RANGE  │ 50%     │ FixedBitSet │ 261 µs    │ 145 µs  │ ~1.8×             
│
     │ RANGE  │ 50%     │ Roaring     │ 235 µs    │ 193 µs  │ ~1.2×             
│
     
└────────┴─────────┴─────────────┴───────────┴─────────┴───────────────────┘
   
   ```


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