Our site with lots of block and specifically, lots of Views blocks was suffering tremendously on Panels pages because of some code that was listing all blocks on the site. It does this for each pane in the panel. Queries weren't a huge problem, but Views unpacking functions were being looped through an ungodly number of times causing a bottleneck in PHP execution time.

This patch adds 2 lines of code to store the block list in a static array, so the block list only has to be generated once per page and not once per panel pane.

This patch reduced our page load time by more than half.

CommentFileSizeAuthor
ctools-block-list-cache.patch488 bytesnrambeck

Comments

gerhard killesreiter’s picture

Status: Active » Needs review

needs review

crea’s picture

subscribing

sdboyer’s picture

Status: Needs review » Fixed

This probably is the best solution, as implementing the content_type callback (for retrieving information on a single specified block, rather than iterating over all blocks in the system) isn't feasible due to the listing coming from the block hook invocation. So the memory overhead from the static var is a worthwhile tradeoff. Committed, after some fixing.

Please format your patches properly in the future: http://drupal.org/patch

sdboyer’s picture

Status: Fixed » Closed (won't fix)