PHP 10.0 Blog

What if…

Optimizations?

Posted by Stas on November 24, 2006

When compiling PHP code, there are a lot of constants that are used for lookups and are stored in opcodes. I wonder why the engine won’t precalculate hashes and store them? OK, PHP 5.1 has CVs, which does it for variables. But there are also classes, functions, constants. This would, of course, make some parts of the engine code more complicated since we may deal with non-constant call too, in which case the hash won’t be pre-calculated, but it still can be done I think. On top of that, due to the fact that classes and functions are case-insensitive, a lot of lowercasing is going on too, which might be saved too.

One Response to “Optimizations?”

  1. yanush said

    ok. thanks.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>