php - PHP5 performance comparison, Windows and Linux -
i have question symfony2 performance.
i have been developing symfony2 under ubuntu 11.04 few weeks now, apache 2.2.17, php 5.3.5, apc 3.1.9, no xdebug
on dev environment, time given on symfony2 toolbar never above 70 ms.
today, i've tried install app on windows 7 environment : wampserver 2.2, php 5.3.8, apache 2.2.21, apc 3.1.7, no xdebug
the computer on windows environment better 1 on ubuntu (ssd, quad core, etc).
and when run application on dev environment, toolbar indicates minimum of 300 ms.
so, know how possible ?
thanks !
edit : found link subject : http://fossplanet.com/f6/%5bsymfony-users%5d-symfony2-slow-windows-xp-116465/
i noticed problem file_exists function (using webgrind).
so, ideas ?
maybe subject has been discussed, surprised not find related.
tl;dr; set realpath_cache_size value > 1000
edit 2: problem solved in pr: try set php.ini's realpath_cache_size value > 1000 symfony requirement added fixing issue: https://github.com/sensiolabs/sensiodistributionbundle/commit/cf0179711b24d84d4a29d71a4010540f4c990bd8
edit: saw answer: https://stackoverflow.com/a/17914570/980547 , decreased page generation time 4 on windows when set realpath_cache_size=4096k in php.ini (!)
old answer:
so, did comparison between both webgrind:
on windows (fast computer), called app_dev.php:
so can see web toolbar shows 764ms time generation (increased because of xdebug , profiling, still relevant). webgrind shows:
- 651 calls file_exists() time of 232ms (which lot!)
- 603 calls filemtime() (211ms)
- 230 calls universalclassloader->loadclass() (119ms)
- 230 calls universalclassloader->findfile() (38ms)
on linux (slow computer), app_dev.php:
298ms of total generation time (which more twice less on windows).
- 237 calls universalclassloader->findfile() (36ms => 4 times less)
- 237 calls universalclassloader->loadclass() (20ms => 2 times less)
- 623 calls file_exists() (4ms !!!)
- 605 callsd filemtime() (4ms !!!)
the problem seems file_exists() , filemtime(), slower on windows on linux. on windows, php looking files file_exists, filemtime, loadclass or findfile 60% of time. known problem ?
edit : problem dev environment, in production no file_exists done since cached.
Comments
Post a Comment