Re: Performance improvements
| From: | Moriyoshi Koizumi | Date: | Thu, 25 Mar 2010 07:20:05 +0000 |
| Subject: | Re: Performance improvements | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-47589@lists.php.net to get a copy of this message | ||
Hi,
On Thu, Mar 25, 2010 at 8:41 AM, Stanislav Malyshev <stas@zend.com> wrote:
> Hi!
>
>> Wouldn't it suffice to add a field for the hash value and a flag that
>> indicates its validity to zval instead of appending zend_literal
>> everywhere?
>
> Enlarging zval would be costly (the engine uses tons of zvals) and may also
> be more complicated to track (all zval operations now would also have to
> take care to set the flag right - what if we forget in some extension to set
> it right?). I think it's better not to mess with zval.
If all the constants were "intern"ed, then we should not need
zend_literal in the first place because we can store the hash values
separately in an array whose indices correspond to those of the
interned string vector. Plus, I think the hash value can be stored in
the following extra bytes of the string buffer pointed by str.val.
Moriyoshi