Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86646 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88722 invoked from network); 15 Jun 2015 09:06:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2015 09:06:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.160.180 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.160.180 mail-yk0-f180.google.com Received: from [209.85.160.180] ([209.85.160.180:33583] helo=mail-yk0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/70-19613-6A59E755 for ; Mon, 15 Jun 2015 05:06:47 -0400 Received: by ykfr66 with SMTP id r66so51207363ykf.0 for ; Mon, 15 Jun 2015 02:06:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=WVBHwA1UMFUIJwyCGHd1OOpXwMzyDcQCAa93ORLco1o=; b=Sx2CtCWswKgun+SyOsix9P+Exq0VHMZdAht25Q7uH9GEuOVPfQpWHN4k3O69hdJtsa Qj6k2JXkOiEmr6gPlK3VPmuRsQgr0DHOFc7v3lgifwZBURpkuGOnw2XHLocgNrbIgy4s hjnhS1zirjgVhsUrzTMHanZGIHLKFsstymagfx4stKUf6hfKWjkrBAPEXrGCdauIvbSd H1co/BFSLt9FUUlACPkfmcbInnLZVpZlNp0E5aSQNqo+HoMZgxb9YQr8fqR4PlCnxo7j bLLeAUHho6FDqKa7CdaM6NzJlpr1NMLUgXSX4jHut63N0tegU+GbdcqiVN0H0bQq4di5 g3uw== X-Gm-Message-State: ALoCoQkpN/njpwE1XYEG8r0KQENxd7Hq6C0Tssd0GpmQhtUa1yFBF/3Id5kNJrPcNwwj+KXEJ6w9MRWdw2xcm7GxiVQniayVNSGOeLEVe5fyaTmxF3L4ekerPWnj69/aRHM5QIXmPYtjI2z64LLOvw9mlt3d+Fq7qtD9L9OgFXES4zhRC0K1rZI= MIME-Version: 1.0 X-Received: by 10.52.228.42 with SMTP id sf10mr39635098vdc.12.1434359203973; Mon, 15 Jun 2015 02:06:43 -0700 (PDT) Received: by 10.31.10.201 with HTTP; Mon, 15 Jun 2015 02:06:43 -0700 (PDT) In-Reply-To: References: Date: Mon, 15 Jun 2015 12:06:43 +0300 Message-ID: To: Yasuo Ohgaki Cc: Levi Morrison , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e01184d7ad56a7d05188ac62d Subject: Re: [PHP-DEV] Packed array is not fast? From: dmitry@zend.com (Dmitry Stogov) --089e01184d7ad56a7d05188ac62d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I see only the test for "packed" array. You may create similar "hash" array, initializing it in reverse order. In my experiments "packed" arrays are slightly (8%) faster. $ sapi/cli/php packed.php Time: 0.022471189498901 Time: 0.012310028076172 $ sapi/cli/php hash.php Time: 0.024425029754639 Time: 0.012874126434326 Thanks. Dmitry. On Mon, Jun 15, 2015 at 6:51 AM, Yasuo Ohgaki wrote: > Hi Levi, > > On Mon, Jun 15, 2015 at 12:35 PM, Levi Morrison wrote: > > > How are you testing hash vs packed? As far as what you posted I cannot > > tell a difference =E2=80=93 it looks like you are running the same thin= g twice > > (same binary and same input file). > > > > I've modified START index and verified both packed and unpacked array is > used > by using gdb. I didn't analyze whole execution, but only zend_hash.c > > I didn't paste slightly different code because it will not give us much > difference > and it's useless services like 3v4l. > > I'm a little disappointed by the result because I was expecting much bett= er > result with packed array.. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > --089e01184d7ad56a7d05188ac62d--