Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 20647 invoked from network); 15 Mar 2011 20:42:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Mar 2011 20:42:52 -0000 Received: (qmail 69163 invoked by uid 500); 15 Mar 2011 20:42:51 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 69126 invoked by uid 500); 15 Mar 2011 20:42:51 -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 69119 invoked by uid 99); 15 Mar 2011 20:42:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2011 20:42:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_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; Tue, 15 Mar 2011 20:42:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B5B233AB01B for ; Tue, 15 Mar 2011 20:42:29 +0000 (UTC) Date: Tue, 15 Mar 2011 20:42:29 +0000 (UTC) From: "Dawid Weiss (JIRA)" To: dev@lucene.apache.org Message-ID: <853840591.4830.1300221749726.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <101915481.3554.1300196129629.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (LUCENE-2967) Use linear probing with an additional good bit avalanching function in FST's NodeHash. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-2967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007164#comment-13007164 ] Dawid Weiss commented on LUCENE-2967: ------------------------------------- Yes, now I see this difference on the 38M too: trunk: {noformat} 56.462 55.725 55.544 55.522 {noformat} w/patch: {noformat} 59.9 59.6 {noformat} I'll see if I can find out the problem here; I assume the collision ratio should be nearly identical... but who knows. This is of no priority, but interesting stuff. I'll close if I can't get it better than the trunk version. > Use linear probing with an additional good bit avalanching function in FST's NodeHash. > -------------------------------------------------------------------------------------- > > Key: LUCENE-2967 > URL: https://issues.apache.org/jira/browse/LUCENE-2967 > Project: Lucene - Java > Issue Type: Improvement > Reporter: Dawid Weiss > Assignee: Dawid Weiss > Priority: Trivial > Fix For: 4.0 > > Attachments: LUCENE-2967.patch > > > I recently had an interesting discussion with Sebastiano Vigna (fastutil), who suggested that linear probing, given a hash mixing function with good avalanche properties, is a way better method of constructing lookups in associative arrays compared to quadratic probing. Indeed, with linear probing you can implement removals from a hash map without removed slot markers and linear probing has nice properties with respect to modern CPUs (caches). I've reimplemented HPPC's hash maps to use linear probing and we observed a nice speedup (the same applies for fastutils of course). > This patch changes NodeHash's implementation to use linear probing. The code is a bit simpler (I think :). I also moved the load factor to a constant -- 0.5 seems like a generous load factor, especially if we allow large FSTs to be built. I don't see any significant speedup in constructing large automata, but there is no slowdown either (I checked on one machine only for now, but will verify on other machines too). -- This message is automatically generated by JIRA. 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