Re: [RFC] Named parameters
| From: | Nikita Popov | Date: | Mon, 09 Sep 2013 19:50:42 +0000 |
| Subject: | Re: [RFC] Named parameters | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68978@lists.php.net to get a copy of this message | ||
On Fri, Sep 6, 2013 at 8:01 PM, Johannes Schlüter <johannes@schlueters.de>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