Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 292357A0C for ; Wed, 21 Dec 2011 08:18:02 +0000 (UTC) Received: (qmail 92879 invoked by uid 500); 21 Dec 2011 08:18:00 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 92780 invoked by uid 500); 21 Dec 2011 08:17:59 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 92748 invoked by uid 99); 21 Dec 2011 08:17:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2011 08:17:57 +0000 X-ASF-Spam-Status: No, hits=-2002.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2011 08:17:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B4D4911F23D for ; Wed, 21 Dec 2011 08:17:30 +0000 (UTC) Date: Wed, 21 Dec 2011 08:17:30 +0000 (UTC) From: "Dawid Weiss (Commented) (JIRA)" To: dev@lucene.apache.org Message-ID: <491476004.34626.1324455450742.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <779609110.23074.1324157370732.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LUCENE-3654) Optimize BytesRef comparator to use Unsafe long based comparison (when possible) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-3654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173941#comment-13173941 ] Dawid Weiss commented on LUCENE-3654: ------------------------------------- There's been an interesting discussion about the common use of Unsafe on hotspot mailing list recently (can't recall the thread now though). Some people even wanted Unsafe to become part of standard library (not unsafe accesses -- the lock checking part, but nonetheless). This guy wrote an entire off-heap collections library on top of Unsafe: http://www.ohloh.net/p/java-huge-collections I think using Unsafe with a fallback is fine, especially in small-scope methods that are used frequently and can be thoroughly tested. BytesRef is such an example to me. This said, it would certainly help to convince Robert and others if you ran benchmarks alongside with and without Unsafe and show how much there is to gain, Shay. > 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 - 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org