apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.46k stars 979 forks source link

Use Arrays.compareUnsigned instead of iterating compare. #13252

Closed vsop-479 closed 2 months ago

vsop-479 commented 3 months ago

Similar to SegmentTermsEnumFrame, we can use Arrays.compareUnsigned instead of iterating compare, in SegmentTermsEnum.seekCeil and SegmentTermsEnum.seekExact.

vsop-479 commented 3 months ago

@mikemccand

Please take a look when you get a chance.

rmuir commented 3 months ago

This looks like a good improvement, these Arrays methods become much faster than the home-written loops for longer arrays.

mikemccand commented 3 months ago

Woops, there are now conflicts here (from the binary search PR) -- maybe you could resolve them @vsop-479, and add a CHANGES.txt entry too? Thanks!

vsop-479 commented 3 months ago

I will resolve the conflicts, and try to find other handwritten loops. Thanks @mikemccand @uschindler .

vsop-479 commented 2 months ago

@mikemccand I resolved the conflicts, and added a CHANGES.txt entry. Please take a look when you get a chance.