Re: Structured Code vs. Performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jochem Maas wrote:
Stut wrote:
Jochem Maas wrote:
Stut wrote:
Jo chem baas wrote:

            ^- wtf happened here? :-) it's quite funny if you know dutch :-)

Pass. Looking back it looks like it happened one of the times I replied. Didn't do it on purpose, honest! ;)

Whether there is conditional definition or not, the opcode cache will
look the same. The reason for this is that function and class
definitions happen at runtime not compile time. This would have to be
the case for conditional definition to work at all, since the compiler
cannot determine the value of a condition at compile-time.
okay, but I was just paraphrasing the man Rasmus, although I admit I may
have misinterpreted (or misundersstood the 'why') - thought I pretty sure
he has written on a number of occasions that code like the following
sucks
for op-code caches and should be avoided:

if (foo()) {
    class Foo { }
}
Hopefully he's reading and will be able to give us a definitive answer.

here is the post that I was recalling:

	http://lists.nyphp.org/pipermail/talk/2006-March/017676.html

I believe his third point validates what I was saying although I did
make a bit of a mess with regard of my use of terminology.

Hmm, Rasmus seems to be saying that opcode caches have a way to optimise the definition of entities, and by defining them conditionally they can't make use of that. That kinda makes sense, but I'd expect the difference to be negligible unless you're talking about a file with thousands upon thousands of definitions.

Anyhoo, back to the coalface.

-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux