Hi,

don't know if a patch already exists but completly rewrite this function because :
- it could be called very often (specially when using this path). Without static cache, we make a lot of useless queries...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chaby’s picture

Status: Active » Needs review
FileSize
1.72 KB
chaby’s picture

rewrite it again to cache all blocks set per role types. Like core block module, we hope we won't have a lot of block set per roles.
If you have 10 blocks in a page and don't use ajax, it will make only 1 query instead of 20...
So here is a new patch with a useless interdiff because completly rewrite.

chaby’s picture

Title: _homebox_can_view_block() invalid and performance improvement » _homebox_can_view_block() - performance improvement
chaby’s picture

reroll because forgot to init cache

chaby’s picture

Issue summary: View changes

up

mgifford’s picture

Issue summary: View changes
Issue tags: +Performance

I haven't checked the performance improvements, but there would have to be as right now you'd have to call it per block role. I do wonder if it would make sense to use drupal_static() like #2153629: homebox_get_page() should static cache.

Anyways, mostly reporting that the latest patch works and should be an improvement.

drumm’s picture

Status: Needs review » Closed (duplicate)

There was already a patch for this: #1372406: Cache query results in _homebox_can_view_block() (D7 version). I like that one uses drupal_static() and I think might have more code comments.