Debug Site Performance Using Web Profiler in Drupal 8
In the beginning of any Drupal project the site loads very quickly because there aren’t many modules installed. But as you add modules, the performance of the site will become slower and slower.
There’s always a certain point in the project where you realize it’s time to look at the problem and see if it’s a rogue module or some dodgy code, we’ve all seen this.
Trying to debug a performance issue can be tedious work. But often, it comes down to having too many queries loaded on a page.
If you’re on Drupal 7, just enable query logging using the Devel module. This will show all the queries generated at the bottom of the page.
But for Drupal 8 we have something better: Web Profiler.
Web Profiler is a Drupal 8 port of the Symfony WebProfiler bundle. The port is possible because Drupal 8 uses Symfony components.
Web Profiler adds a toolbar at the bottom of every page and shows you all sorts of stats such as the amount of database queries loaded on the page, which services are used and much more.