In the Drupal community, we always recommend using the Drupal API, and best practices for development, management and deployment. This is for many reasons, including modularity, security and maintainability.
But it is also for performance that you need to stick to these guidelines, refined for many years by so many in the community.
We have written before about Drupal Memory usage by modules, and the Open Buffet binge syndrome.
But this time, it was different. Modules were not to blame.
While inspecting a site that had several performance problems for a client, we noticed is that memory usage was very high. From the "top" command, the RES (resident set) field was 159 MB, far more than what it should be.
We narrowed down the problem to a view that is in a block that is visible on most pages of the site.
A client contacted us to assist them in finding a solution for slow page times for their site.
All the pages of the site were slow, and taking 2.9 to 3.3 seconds.
Upon investigation, we found that one view was responsible for most of that time.
However, the query execution itself was fast, around 11 ms.
But, the views rendering time was obscenely high: 2,603.48 ms!
So, when editing the view, you would see this at the bottom:
Query build time 2.07 ms Query execute time 11.32 ms View render time 2,603.48 ms
Is your Drupal site slow?