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

   ### Description
   
   <!--
   If this is your first contribution to Lucene, please make sure you have 
reviewed the contribution guide.
   https://github.com/apache/lucene/blob/main/CONTRIBUTING.md
   -->
   
   
   RadixSort involves a large number of statistical histogram calculations, 
there are numerous byteAt calls. 
   Currently, byteAt calls `get` to retrieve the BytesRef corresponding to 
position i from the pool, 
   and then uses `cmp.ByteAt` to get the value of BytesRef at position k.
   
   Because the byteAt calls are so frequent, they cause an observable 
performance penalty.
   
   Therefore, we can directly retrieve the byte values ​​corresponding to start 
and i from the pool.
   
   Use save environment as https://github.com/apache/lucene/pull/15772
   
   ## without #15772 + without pool.byteAt
   ```
   sort 33554432 unique terms in 4543.19 ms
   ```
   
   ## without #15772 + with pool.byteAt
   ```
   sort 33554432 unique terms in 3866.08 ms.      (4543.19 - 3866.08) / 4543.19 
= 0.149
   ```
   
   ## with #15772 + without pool.byteAt
   ```
   sort 33554432 unique terms in 3385.94 ms
   ```
   
   ## with #15772 + with pool.byteAt
   ```
   sort 33554432 unique terms in 2937.54 ms.       (3385.94 - 2937.54) / 
3385.94 = 0.132
   ```
   
   
   However, I'm not sure if this change is appropriate from a code structure 
perspective, 
   although it does improve performance.
   
   
   @dweiss @mikemccand    please take a look and give some advice
   


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