Wednesday, August 6. 2008
As requested I did my homework today and tested Stubbles against PHP 5.3 alpha1. Well, actually alpha2-dev, but that should not make that much difference. I don't know whether 5.3 is PHP on drugs, but runtime of our unit tests dropped from around 45 seconds with 5.2.5 to around 15 seconds on 5.3. Down to one third! This is really impressive. We will have to see how 5.3 will perform with the applications itself, but this raises expectations.
The other good news is that we only had two forward compatibility issues, which I instantly fixed. One of them was in a unit test and not relevant to the framework itself, the other had to do with a new check on callbacks which now forbids using private methods in callbacks, even if the callback is triggered from inside the same class.
At first I thought of just another check for the callback thing, but the comments lead me to reinspect the code. I now think it might really be a bug in PHP 5.3, therefore I created a small script to reproduce the effect, see /a href="http://www.stubbles.org/exit.php?url_id=326&entry_id=50" title="http://stubbles.net/browser/labs/experiments/general/php53/private_callback.php" onmouseover="window.status='http://stubbles.net/browser/labs/experiments/general/php53/private_callback.php';return true;" onmouseout="window.status='';return true;">repository. I sent it it to Lars, who will make sure it gets fixed in the final release.
Display comments as (Linear | Threaded)
Isn't this callback thing a bug ?
May be you should submit it ?
After all, that's what alpha are for...
#1 Nicolas Grekas on 2008-08-06 18:39
Makes me think about so many java vs php articles. Is there any chance that some next java version would be 2-3 times faster:D?
And PHP6 with maby imrovements is coming...
I've tried to reproduce the private method callback thing but didn't made it. Could you send me an example? I guess it is a bug and not an expected regression.
Well PHP6 is likely to be a slow down for all. Hopefully not too big, but unicode will put a damper on things. Hurray for moores law
Does this compare non-APC with APC perhaps? Does 5.3 embed APC?
#5 Ron on 2008-08-07 11:07
APC will be included with PHP6, but I doubt that it will be enabled by default.
Other topic: AFAIK the GC collection is enabled by default and will automatically trigger cleanup when about 1k items are in the buffer (though this can be disabled). Could you check how GC affects your benchmarks and how this affects memory usage?
In the meantime I think I know where the improvements come from. We have a kind of special situation when running our unit tests. They are run via Phing, but in an separate PHP process triggered via exec(). As I did the tests under Windows with a precompiled binary the improvements might arise from a much faster PHP startup.
#6.1 Frank Kleine on 2008-08-07 13:24
And how is using PHP 5.3 different from 5.2 in that situation?
#6.1.1 Ron on 2008-08-07 15:30
Usage is not different, but on windows PHP startup takes some time with version prior to 5.3. Its just something I noticed, I can not say what's the reason for this.
#188.8.131.52 Frank Kleine on 2008-08-07 18:03
/a href="http://www.stubbles.org/">Frontpage - /a href="#topofpage">Top level
Powered by /a href="http://www.s9y.org">s9y - Design by /a href="http://www.mistralys.com/">Mistralys