Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69804 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56060 invoked from network); 23 Oct 2013 13:52:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2013 13:52:59 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.54 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.54 mail-oa0-f54.google.com Received: from [209.85.219.54] ([209.85.219.54:59004] helo=mail-oa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/2C-10840-AB4D7625 for ; Wed, 23 Oct 2013 09:52:58 -0400 Received: by mail-oa0-f54.google.com with SMTP id o20so827164oag.13 for ; Wed, 23 Oct 2013 06:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AjAgNymduJdXB+n1zXYrDNPxMHRTDh/mYbi4JFDxD8o=; b=1JHXdnntuJax3UuOmxIZHAdivkKSGFmkH6dYz2phYXtEHfD+tbpz1fcUANo8NR1bmb cmNB4rUrnYutOLxSQVa0R38G7A7KdsyKAbAOHOEqD+MyW64SEpS2Rnd+UBp+DbVVUV5j LpGKDuQ/TfdkjGttQ0F6ckPpRr8ij0Rd8p7DeYBV/a3GQl8EWURBzUWbdSpcUInD23tw Jsgb91KjXlyI5ukfYZM80swjchNBcRYH7Grvus9V1wFO05HDumTKaC7Q0E3Ay0Z2ZeP2 RIBuRKVKssBWQOjW9LQE5bwuB4hq1xVoiRExbjNnpexjT3cmx4lgS5B8VvN0fEDS4TYQ Ae8A== MIME-Version: 1.0 X-Received: by 10.182.214.98 with SMTP id nz2mr1648960obc.37.1382536375889; Wed, 23 Oct 2013 06:52:55 -0700 (PDT) Received: by 10.182.54.112 with HTTP; Wed, 23 Oct 2013 06:52:55 -0700 (PDT) In-Reply-To: References: Date: Wed, 23 Oct 2013 15:52:55 +0200 Message-ID: To: Dmitry Stogov Cc: Julien Pauli , David Soria Parra , Stas Malyshev , PHP Internals Content-Type: multipart/alternative; boundary=e89a8ff1cefe92f51904e968d598 Subject: Re: [PHP-DEV] Improved performance of array_maerge() and func_get_args() From: nikita.ppv@gmail.com (Nikita Popov) --e89a8ff1cefe92f51904e968d598 Content-Type: text/plain; charset=ISO-8859-1 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 --e89a8ff1cefe92f51904e968d598--