Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86708 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87187 invoked from network); 16 Jun 2015 11:04:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2015 11:04:50 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.179 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.212.179 mail-wi0-f179.google.com Received: from [209.85.212.179] ([209.85.212.179:38069] helo=mail-wi0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/01-14163-0D200855 for ; Tue, 16 Jun 2015 07:04:49 -0400 Received: by wibdq8 with SMTP id dq8so15702904wib.1 for ; Tue, 16 Jun 2015 04:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=jjD8he/0aANXxlqw/qmK5EnWAe8pCOzneM1r4PhR3+0=; b=nkIedM5jIXaEtwvi2RFxl5orIexe4w9P71r1pk7U8VWslhJJwzASkaeH6rMnRb7gPF 4edT0OlOK5zond9pzOGO7oe9SZb573tzI6P+MWkLuB9gMR+suOE6f8y5AMVFsJcwgIe5 r51tzQoDDxwNhK+g0dCrhBaIw1sz2jsRe/JPAvVZZHvSxTpux384tri+xJGffO9kZMBG IV/OtjBQpo4pbEjgJmt0T3gXkHfg64kncZ7+EgXv+rsmSAZATAez02Ty2Wu1WN0csUn+ tvwh2Sji+53BMcH67ylMXqSSEXbhAYIgshhpIOU2xWxfEzNR77luqvRO/O3BnJCzOYWs SBwg== X-Received: by 10.180.24.65 with SMTP id s1mr5487019wif.66.1434452686381; Tue, 16 Jun 2015 04:04:46 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.194.120.198 with HTTP; Tue, 16 Jun 2015 04:04:06 -0700 (PDT) In-Reply-To: References: Date: Tue, 16 Jun 2015 13:04:06 +0200 X-Google-Sender-Auth: Qwlcj2cwCB74Ub8Rt7wgzWoy3n4 Message-ID: To: Dmitry Stogov Cc: Yasuo Ohgaki , Levi Morrison , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d043bdf2ad1a6420518a08a6e Subject: Re: [PHP-DEV] Packed array is not fast? From: jpauli@php.net (Julien Pauli) --f46d043bdf2ad1a6420518a08a6e Content-Type: text/plain; charset=UTF-8 First of all, I tried it against a PHP5 codebase, not PHP7. I simply patched it about return type (casted it to our ulong , taking care of 32/64 platforms), then I very simply #define zend(_inline)_hash_func to mumurhash2. Then I ran a callgrind on an extension of mine (closed source), that heavily makes use of zend_inline_hash_func. I noticed with callgrind result graph that this latter took twice less time when the macro was defined to target murmurhash2 than DJB33. And the zend_hash_quick_****() calls called later with such a hash did not seem to take longer time, though the collision rate stayed barely the same. This is a quick test as #defining in an extension is abviously not safe at all, but as I fully use the _quick_ API, the compiled PHP codebase doesnt make use of zend_hash_func itself (which would lead to DJB33) Julien.P On Tue, Jun 16, 2015 at 11:53 AM, Dmitry Stogov wrote: > Hi Julien, > > Could you be more specific. From the first look MurmurHash2is more > expensive, but may be it reduces number of collisions. > what implementation(s) did you use (src or patch)? how did you measure the > speed? did you try to embed it into PHP? > > Thanks. Dmitry. > --f46d043bdf2ad1a6420518a08a6e--