lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3654) Optimize BytesRef comparator to use Unsafe long based comparison (when possible)
Date Sun, 18 Dec 2011 01:41:31 GMT


Uwe Schindler commented on LUCENE-3654:

Nice, I remember Jason brought this up!

My problem is only: sun.misc.Unsafe is undocumented, so it might not be available on compile
time. Can we handle that somehow without reflection, maybe in a separate file where we dont
fail if the javac ant task fails? I know, Unsafe is always available, but I dont want to rely
on it - maybe someone wants to compile our code with SomeStrangeJDK™.
The other thing is the inner class holder. Can we rename it to not contain "lexicographical",
maybe UnsignedByteComparatorHolder? Lucene works on byte[] that can be anything, even binary
> Optimize BytesRef comparator to use Unsafe long based comparison (when possible)
> --------------------------------------------------------------------------------
>                 Key: LUCENE-3654
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/index, core/search
>            Reporter: Shay Banon
>         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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message