Re: RE: [RFC] Fast Parameter Parsing API
| From: | Stas Malyshev | Date: | Tue, 27 May 2014 02:56:51 +0000 |
| Subject: | Re: RE: [RFC] Fast Parameter Parsing API | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-74511@lists.php.net to get a copy of this message | ||
Hi!
> then when doing register internal function. Zend vm will bind the Z_ARG_STR to
>
> int num_args = 0;
> (zend_internl_functions
> *)(strlen_function)->argument_handlers[num_args++] =
> zend_parse_parameter_str;
>
> the zend_parse_parameter_str here is the handler only handling with
> str(which will be effective)
That's what I was talking about when I was mentioning function pointers,
but then we'll still have a loop with a bunch of function calls instead
of an unrolled loop like the current proposal does. Which is more
expensive since the execution flow has to jump back and forth...
> this implementation will doing 5 functions call..... which
> maybe slower than previous zend_parse_parameter
Yes, exactly. So far I didn't find any good idea (well, short of
implementing real JIT which sounds hard) that would fix that problem.
Maybe we could do the same we did with the opcodes - have additional
step of generating the arg parsing code and the data for each function
before compiling. But doing it for every function seems to be overkill
and will complicate the build system a lot.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227