[PHP4BETA] MAJOR: Optimization patch committed
| From: | Zeev Suraski | Date: | Mon, 12 Apr 1999 21:53:21 +0000 |
| Subject: | [PHP4BETA] MAJOR: Optimization patch committed | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-95@lists.php.net to get a copy of this message | ||
Hey. We've committed an optimization patch, which may not give us such a
huge performance boost, has, possibly, major implications.
Arguments in PHP4 are no longer passed using a hash table, but through a
highly optimized stack. This should give us a serious performance boost,
even though we haven't finished optimizing it yet and we haven't yet
performed benchmarks.
Thanks to macros, this change was done in an almost transparent way. There
are very few functions that hardcode the type of 'ht' as HashTable, in
fact, there was just one in formatted_print (even though I guess there are
a few more in the various SQL modules, as far as I recall). In most cases,
they can be safely converted to ht's new type, which is int, and is now the
number of arguments passed to the function. The ARG_COUNT(n) macro now
simply returns n, so ARG_COUNT() still works as advertised, as well as
getParameters() and getParametersArray(), which were modified to make this
change completely transparent.
The only functions to which this change is not transparent are functions
that relied on the ht actually being a hash table. From first glance, the
only such function that comes in mind is minmax(). This function will have
to be implemented in a different way for it to work with Zend.
As Microsoft likes to say, this patch is not thoroughly tested and you
should use it at your own risk. I haven't yet put it through the misery of
running a full featured web site, but I will very soon, and I hope I'll
sort out most outstanding bugs right away. It does, however, already run
through many tests we've put it through.
Stig - if you're running a site that's in one stage or another of being in
production, make sure you don't rely on this for at least the next 24
hours, until it gets through its childhood :)
I'd be happy to hear if it actually works for you, and whether you notice
any performance gain.
Zeev
--
Zeev Suraski <zeev@zend.com> http://www.zend.com/
For a PGP public key, finger bourbon@netvision.net.il
--
PHP 4 Beta