PHP magic performance decrease point!!!
Posted: Sat Feb 22, 2003 12:09 am
I found a very unpleasent thing in PHP.
From one point PHP performance decreases about 328 times (on my box).
I did following experiment:
## generated php script with python
>>> s = """<?php list($s_usec,$s_sec) = explode(" ",microtime()); ?>%s<?php list($e_usec,$e_sec) = explode(" ",microtime()); print (($e_sec+$e_usec)-($s_usec+$s_sec)); ?>""";
>>> open('test1.php','wb').write(s % ('.'*16895));
>>> open('test2.php','wb').write(s % ('.'*16896));
The first script test1.php gets time:
0.0001889467239379
The second script test2.php gets time:
0.062012076377869
It's about 328.19873817050217 times slower!!!
I have tested it in various ways and it's allways like this!!!
It means there is a certain page size in PHP from where performance will be tramatically decreased!!! One thing is certain it's in range 16800..17000 bytes.
Is anyone familiar with this problem?
How to increase this size?
Could it be done during compilation?
From one point PHP performance decreases about 328 times (on my box).
I did following experiment:
## generated php script with python
>>> s = """<?php list($s_usec,$s_sec) = explode(" ",microtime()); ?>%s<?php list($e_usec,$e_sec) = explode(" ",microtime()); print (($e_sec+$e_usec)-($s_usec+$s_sec)); ?>""";
>>> open('test1.php','wb').write(s % ('.'*16895));
>>> open('test2.php','wb').write(s % ('.'*16896));
The first script test1.php gets time:
0.0001889467239379
The second script test2.php gets time:
0.062012076377869
It's about 328.19873817050217 times slower!!!
I have tested it in various ways and it's allways like this!!!
It means there is a certain page size in PHP from where performance will be tramatically decreased!!! One thing is certain it's in range 16800..17000 bytes.
Is anyone familiar with this problem?
How to increase this size?
Could it be done during compilation?