From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757570AbZBLNrL (ORCPT ); Thu, 12 Feb 2009 08:47:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757153AbZBLNqw (ORCPT ); Thu, 12 Feb 2009 08:46:52 -0500 Received: from an-out-0708.google.com ([209.85.132.251]:27945 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753084AbZBLNqv (ORCPT ); Thu, 12 Feb 2009 08:46:51 -0500 MIME-Version: 1.0 In-Reply-To: References: <20090212001223.GA5757@movementarian.org> Date: Thu, 12 Feb 2009 08:46:49 -0500 Message-ID: Subject: Re: [PATCH] Update jhash.h with the new version of Jenkins' hash From: Kyle Moffett To: Jozsef Kadlecsik Cc: wli@movementarian.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, Rusty Russell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 12, 2009 at 4:11 AM, Jozsef Kadlecsik wrote: > The current jhash.h implements the lookup2() hash function by Bob Jenkins. > However, lookup2() is outdated as Bob wrote a new hash function called > lookup3(). The new hash function > > - mixes better than lookup2(): it passes the check that every input bit > changes every output bit 50% of the time, while lookup2() failed it. > - performs better: compiled with -O2 on Core2 Duo, lookup3() 20-40% faster > than lookup2() depending on the key length. Well, there's another question which is not addressed by Bob Jenkins' design docs: Kernel code usually runs cache-cold, whereas Bob Jenkins did most of his testing cache-hot in tight loops. If you compile both lookup2 and lookup3 with -Os and run them in a loop with a cache flush, how well do they compare then? Cheers, Kyle Moffett