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

   ### Description
   
   I noticed that we were seeing `StableRadixSorter` faster than `RadixSorter` 
in [#91](https://github.com/apache/lucene/pull/91#issuecomment-823949164). And 
the `StableRadixSorter` becomes even faster after we use a `MergeSorter` 
instead of `InPlaceMergeSorter` in https://github.com/apache/lucene/pull/12652. 
This PR proposes to use a `StableRadixSorter` instead of the `RadixSorter` for 
`BytesRefHash`, in favor of the fact that `BytesRefHash` always [guarantees the 
2x space for the 
`ids`](https://github.com/apache/lucene/blob/2a31f2835cff11ad0d8fa39834eb17db8605bae7/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java#L238).
   
   In my benchmark that indexing 16 bytes UUIDS, the took of sort ~5,000,000 
terms decreased ~40%.
   
   <!--StartFragment--><byte-sheet-html-origin data-id="1699282869596" 
data-version="4" data-is-embed="false" data-grid-line-hidden="false" 
data-importRangeRawData-spreadSource="https://bytedance.feishu.cn/sheets/Jwjzs3FdXhFbVwtfADJc6L8rnCb";
 data-importRangeRawData-range="&#39;Sheet1&#39;!G1:J12">
   
   flush round | radix sort | stable radix sort |  diff
   -- | -- | -- | --
   1 | 3156 | 1994 | -36.82%
   2 | 3227 | 1993 | -38.24%
   3 | 3030 | 1885 | -37.79%
   4 | 3107 | 1962 | -36.85%
   5 | 3119 | 1890 | -39.40%
   6 | 3382 | 1879 | -44.44%
   7 | 3202 | 1906 | -40.47%
   8 | 3164 | 1867 | -40.99%
   9 | 3212 | 1925 | -40.07%
   10 | 3214 | 1935 | -39.79%
   avg  | 3181.3 | 1923.6 | -39.53%
   
   </byte-sheet-html-origin><!--EndFragment-->
   


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