Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69806 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59264 invoked from network); 23 Oct 2013 14:00:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2013 14:00:24 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 74.125.82.170 cause and error) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:44678] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/EC-10840-776D7625 for ; Wed, 23 Oct 2013 10:00:23 -0400 Received: by mail-we0-f170.google.com with SMTP id u57so858718wes.15 for ; Wed, 23 Oct 2013 07:00:20 -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=MQh5Z3I1/j4tslE+F2hk5mwxlB9/a9te5kQVjSOmt2I=; b=XEYbruDHYTlX7eK38clzUrHNZb+vEJHaqspbZpsoeXU5Kxe0A/1VetEFwz0W8JufLD PSblZo9gjsGJvf2UJgBN/NOjbs9Bk1GNBEv9DJH1EUHww6/slchY14iSPHW/Bf6IMX/6 QQe/KRzdyzNWwT1QXULl7dNVZUw0/j0zyHXdMgQudEz6bTRkc/rQtO1OFePy5TsfDLMj cPYg1GuukWJsDf+AdNeb6y7s8nQDwk5clrydNxGlFfe37E4ym3ytBlu2ZHDWa6UXWkS1 potnuKl3GNFmRAHdXh3iF0F9RWHOhvYCNQ8MMIfA01cfIL09wGPoX9+YAJphft9CYMdR 7l+Q== X-Gm-Message-State: ALoCoQmYL0t1aScAEYpQzsKmiXy0ft0wLy7qNCNwNE9BMEE/XgjbDbpwBr1ftMX2EBJraBOx2CnCzoeI3NP+WgOY2nsn0pPzB8awO4myaYI7DqOP89TGocDIaEPhpO8MgCD1kTMKmXle MIME-Version: 1.0 X-Received: by 10.180.160.240 with SMTP id xn16mr2277652wib.62.1382536820358; Wed, 23 Oct 2013 07:00:20 -0700 (PDT) Received: by 10.227.214.144 with HTTP; Wed, 23 Oct 2013 07:00:20 -0700 (PDT) In-Reply-To: References: Date: Wed, 23 Oct 2013 18:00:20 +0400 Message-ID: To: Nikita Popov Cc: Julien Pauli , David Soria Parra , Stas Malyshev , PHP Internals Content-Type: multipart/alternative; boundary=047d7b6251b0112a2604e968f074 Subject: Re: [PHP-DEV] Improved performance of array_maerge() and func_get_args() From: dmitry@zend.com (Dmitry Stogov) --047d7b6251b0112a2604e968f074 Content-Type: text/plain; charset=UTF-8 makes sense. thanks :) Dmitry. On Wed, Oct 23, 2013 at 5:52 PM, Nikita Popov wrote: > On Wed, Oct 23, 2013 at 2:36 PM, Dmitry Stogov wrote: > >> Hi, >> >> I'm proposing two simple patches that eliminate a lot of useless zval >> copying. >> For example they remove only about 800 calls to zend_hash_copy() (25%) on >> each request to wordpress-3.6.0 home page and make it 2-4% faster. >> >> It's not a questions about master branch, but I think it is also safe to >> commit them into PHP-5.4 and PHP-5.5. >> >> Any objections? >> >> https://gist.github.com/dstogov/7117623 >> >> https://gist.github.com/dstogov/7117649 >> >> Thanks. Dmitry. >> > > No objection, just quick note on func_get_args patch: You can use > SEPARATE_ARG_IF_REF there, so the code in the loop body is: > > zval *arg = *(p-(arg_count-i)); > SEPARATE_ARG_IF_REF(arg); > zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &arg, > sizeof(zval *), NULL); > > Nikita > --047d7b6251b0112a2604e968f074--