Joel Joel - 9 months ago 43
PHP Question

What is the fastest way to find the bottleneck/optimize Magento?

Is there a way to identify quickly a faulty script in Magento that slows down the server?

Magento has something like 35 000 files, so there are so many places it can go wrong, I just need a way to find quickly where to optimize.

For example, could I install a script that would tell me all the files magento reads before outputing a page? And then tell me how much time it takes for each file to execute?

Thanks for your help

Answer Source

xdebug and WebGrind will profile your application.

Though it can be a bit tricky to set up, so I'll just post my configuration and you can take from it what you can (from my WampDeveloper installation)...


zend_extension = "D:\WampDeveloper\Components\Php\ext\php_xdebug.dll"
xdebug.profiler_enable = 1
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "D:/WampDeveloper/Temp/xdebug"
xdebug.trace_output_dir = "D:/WampDeveloper/Temp/xdebug"

Webgrind's config.php

static $storageDir = 'D:/WampDeveloper/Temp/webgrind';
static $profilerDir = 'D:/WampDeveloper/Temp/xdebug';