One of the important steps in improving application performance is profiling. Xdebug produces information for each request. Webgrind is a web interface which ingests this data for analysis.
The Xdebug extension is already installed for you. On production, it can be enabled as needed.
- Open public_html/.htaccess
- Set
xdebug.profiler_enable
to1
and save. Alternatively, edit the next line instead to profile select requests.
If you want to profile "API" requests (e.g., public_api/api_modules/*
functions), do the same for public_api/.htaccess
Clone webgrind into public_html/tools/
.
$ git clone https://github.com/jokkedk/webgrind public_html/tools/webgrind
Use the application. Then, visit http://www.placelocal-dev.com/tools/webgrind/.
Select a cachegrind output file (corresponding to HTTP request) within the top-right dropdown and hit "Update". Below you will see a breakdown of which function calls were the most expensive.