Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wait, let's backtrack here.

I said that natively PHP doesn't cache and the OPCodes are generated every request. You said "Yes it is." meaning presumably you don't feel like that is the case.

You then go on to link to Zend Opcache which is, by all accounts, an extension which provides caching and which wasn't even bundled with PHP until 5.5 (according to yourself). So from 0.1 through 5.4 PHP shipped with zero caching and thus a core part of the language at that time was that it was generated every request.

Now, 5.5 was released in June 2013.

So for a lot of users PHP remains a language which is interpreted when a user makes a request. And even users on 5.5+, the first request per page is effectively interpreted as the cache isn't pre-populated.

So really what is it that we are even discussing? Seems like a debate about semantics at this stage.



> I said that natively PHP doesn't cache and the OPCodes are generated every request. You said "Yes it is." meaning presumably you don't feel like that is the case.

Since when do you backtrack to a completely different subtread (or to a subthread which does not exist)?

* I said that the detection (optimisation) would be performed while generating the bytecode

* You asserted that it's not how PHP works by default

* I replied that it is

You've asserted that Zend PHP does not use an intermediate bytecode during normal operation, do you stand by it? Because that's where we end up if we backtrack, not about the fact that it doesn't cache bytecode by default which is not actually relevant to my point (the existence and widespread use of bytecode cache merely supports said point by further improving the ROI).


> You've asserted that Zend PHP does not use an intermediate bytecode during normal operation, do you stand by it?

I never made that claim, and no I don't stand by a claim I never made.

You've asserted that PHP is actually JavaScript with style, do you stand by it?


> I never made that claim

Sorry to report that yes you did, let me quote exactly (rather than paraphrase):

>> The detection is only done one while generating the bytecode

> That isn't how PHP natively works.

Since "the detection" is obviously a hypothetical assumed in case the compiler ever got a peephole optimizer, the only part of the phrase you could object to is that Zend PHP generates intermediate bytecode.


Bear in mind any new optimizations would be added to 5.5+, which would presumably have opcode caching by default?

[Edit] Maybe a whole new world of possible optimizations has just opened up.


5.5 bundles an opcode cache in the default distribution, but the cache isn't enabled by default AFAIK.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: