There are some serious performance issues with the sections module...

It implements hook_preprocess(), and in that, it calls _sections_in_section(), which does a database query. hook_preprocess() gets called many many times per page - which results in a huge number of database queries for every single page load.

Comments

mrfelton’s picture

Status: Active » Needs review
StatusFileSize
new2.66 KB

You'll need to apply the patch from #685736: Node theme doesn't take precedence over path based sections before applying this.

With that other patch applied, the sections determination is done in hook_init(). This only happens once, and once that has been run, we know what section we are in so there is no need to ask the database again. I have used a global to store the active section, and then in hook_preprocess(), we can simply look at the global to find out what section we are in, rather than asking the database again and again.

mrfelton’s picture

Note that on a typical page on my site, this shaves off between 30-80 database queries!

mrfelton’s picture

StatusFileSize
new2.72 KB

Oops - slight issue with that patch. Use this one.

hass’s picture

There has already been a path committed to fix the performance issues

hass’s picture

Status: Needs review » Closed (duplicate)