Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86703 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41582 invoked from network); 16 Jun 2015 01:29:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2015 01:29:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.213.42 mail-yh0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:36258] helo=mail-yh0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/CB-15639-6EB7F755 for ; Mon, 15 Jun 2015 21:29:10 -0400 Received: by yhan67 with SMTP id n67so1821939yha.3 for ; Mon, 15 Jun 2015 18:29:07 -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=FU/n/Ce/Fie4qTqK+wZNilqWMKG5dtbtOXTMJPV4CpE=; b=HZwuo9trV81vz5UWTDJN6eTrBNxqvlOX74VieFI7eTuHhaa32NY0EtD+AZtl1XPc5Y TTvpyvwOYlVKwU62T4EZPCFhnczRnCDIozzINHUg1SBJw/hDI5FDo2vwtxTiuwPgpGAc K5cyGpiBppOJGYgr8s279Ywj5rvCYG8kdosAzb5bRe4pxfb50mvXnnF2G0UayjQqi+3A twGjs/n9m1JkpEEcp/dG2m4xWBN13t3FQP9Mc8onkaWHlsaHhk0LF7qGvWcgkGFKePVG aOsH/SCmynMfWKGNsTOinvqcA1zs9sAkyfS3FOkIYc1YPuuEWrNxdOCUVZ82J0NwfH4e Wj1g== X-Received: by 10.129.39.21 with SMTP id n21mr22170689ywn.55.1434418147122; Mon, 15 Jun 2015 18:29:07 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.13.246.2 with HTTP; Mon, 15 Jun 2015 18:28:26 -0700 (PDT) In-Reply-To: References: Date: Tue, 16 Jun 2015 10:28:26 +0900 X-Google-Sender-Auth: 4kwbQdbkyEpVa8pFfYbsGdOaTWI Message-ID: To: Dmitry Stogov Cc: Levi Morrison , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11408d8a1e65440518988023 Subject: Re: [PHP-DEV] Packed array is not fast? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11408d8a1e65440518988023 Content-Type: text/plain; charset=UTF-8 Hi Dmitry, On Mon, Jun 15, 2015 at 6:06 PM, Dmitry Stogov wrote: > I see only the test for "packed" array. You may create similar "hash" > array, initializing it in reverse order. > It's better approach to see the difference because the array content is basically the same. > > 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 It's faster on my PC, too. 8% is good enough to have. I'm surprised that PHP's hash is super fast :) Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11408d8a1e65440518988023--