|
Posted by Toby A Inkster on 07/21/07 08:32
Jerry Stuckle wrote:
> Unless you have implemented a PHP optimizer, every PHP file is
> interpreted every time you load the file. There is no intermediate code.
There normally *is* an intermediate form, but it's discarded after each
execution unless you have a PHP cache, such as eAccelerator.
That is, on each execution, the PHP interpreter:
1. Opens up the file;
2. Tokenises it, storing the token stream in memory;
3. Parses it into a form of byte code, storing that in
memory too; then
4. Executes the byte code.
Most smart interpreters (and I assume PHP is included here) will also
perform a bit of code optimisation around stage 3 too. Code optimisation
trades off execution time for parsing time, so interpreters (optimise once,
run once) tend not to optimise as much as compilers (optimise once, run
many) do.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 30 days, 12:01.]
Parsing an HTML Table with PEAR's XML_HTTPSax3
http://tobyinkster.co.uk/blog/2007/07/20/html-table-parsing/
Navigation:
[Reply to this message]
|