You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Adrien Grand (JIRA)" <ji...@apache.org> on 2018/09/25 12:47:00 UTC

[jira] [Resolved] (LUCENE-3654) Optimize BytesRef comparator to use Unsafe long based comparison (when possible)

     [ https://issues.apache.org/jira/browse/LUCENE-3654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrien Grand resolved LUCENE-3654.
----------------------------------
    Resolution: Implemented

Since LUCENE-7966, when using Java 9 or higher, BytesRef comparators will use Arrays#compareUnsigned and Arrays#equals which can compare multiple bytes at once.

> Optimize BytesRef comparator to use Unsafe long based comparison (when possible)
> --------------------------------------------------------------------------------
>
>                 Key: LUCENE-3654
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3654
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/index, core/search
>            Reporter: Shay Banon
>            Priority: Major
>         Attachments: LUCENE-3654.patch
>
>
> Inspire by Google Guava UnsignedBytes lexi comparator, that uses unsafe to do long based comparisons over the bytes instead of one by one (which yields 2-4x better perf), use similar logic in BytesRef comparator. The code was adapted to support offset/length.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org