Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68978 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97447 invoked from network); 9 Sep 2013 19:50:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2013 19:50:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.41 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.41 mail-oa0-f41.google.com Received: from [209.85.219.41] ([209.85.219.41:45220] helo=mail-oa0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/FC-03199-4962E225 for ; Mon, 09 Sep 2013 15:50:45 -0400 Received: by mail-oa0-f41.google.com with SMTP id j6so7032894oag.28 for ; Mon, 09 Sep 2013 12:50:42 -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=fsB7L7IZUlFgcp9tstuGuTNDnv8NOqVGZpHPrb0vizI=; b=HaSrtTkNK5qzyHtiyLED5hfSZ/VFucyHnDtMORs9psFag9SVNd855ttRCBoe4m7lEY kMorZVlB4CXb/LWZMr9zBnfss+AnsnoetHbToD/9r6zHEddOriU4qvgrySUEL3UsMJs3 CdZ6M0FhtD5umfHFGUyFpY9nAtCOHAeRJoaWEWEVrmT8xGXP52U0xsJ8Exhr02OX/7rD h9JfR11VQjaoSNJDNra7wXBe529tE1UnyYlg4e18swyLR97qNNXiGsBAhFoAPayGVr7B /T+A3Yhu/pI1ttNTbugE3nY93/LYAzkguxMDM1O4Mf+JELWInNJ6gAB7/MLpLQNGR7tW oJLQ== MIME-Version: 1.0 X-Received: by 10.60.70.134 with SMTP id m6mr12312402oeu.14.1378756242491; Mon, 09 Sep 2013 12:50:42 -0700 (PDT) Received: by 10.182.98.8 with HTTP; Mon, 9 Sep 2013 12:50:42 -0700 (PDT) In-Reply-To: <1378490503.3656.239.camel@guybrush> References: <1378490503.3656.239.camel@guybrush> Date: Mon, 9 Sep 2013 21:50:42 +0200 Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: PHP internals Content-Type: multipart/alternative; boundary=001a1133458e10cef304e5f8b46c Subject: Re: [PHP-DEV] [RFC] Named parameters From: nikita.ppv@gmail.com (Nikita Popov) --001a1133458e10cef304e5f8b46c Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Sep 6, 2013 at 8:01 PM, Johannes Schl=FCter wrote: > From the explanation it sounds like there shouldn't be a high cost, but > as fcalls are a key operation and already quite slow I wonder if you > could share some benchmarks. (non-debug-non-tsrm-build) > > A good start might be Zend/bench.php. And I understand this is not the > final patch but good to have the order of magnitude. > I didn't see any obvious regressions from Zend/bench.php and this is also what I would expect: The parts relating to named arguments are hidden behind optype-specialization of the send opcodes, so those shouldn't affect perf. There is also a bit extra code in do_fcall_common to handle passing of additional unknown named params, but that's also just two branches in a large mix of other code. So it really "shouldn't" impact performance and judging from Zend/bench.php it doesn't. I also did a very quick test how a normal call compares to one using named params. Right now the latter is about 25% slower. But I'm pretty sure this number can be improved a good bit, e.g. I'm not yet making use of CACHED_PTR to store the argument number of the parameter. Nikita --001a1133458e10cef304e5f8b46c--