Download & Extend

Prevent un-necessary variable cache clear in views_block

Project:Views
Version:7.x-3.x-dev
Component:Miscellaneous
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

The attached patch checks the hashes generated during the hook_block() $op "list" against what is already set before saving them. This prevents variable set from clearing the variable cache when nothing has changed.

AttachmentSize
compare_views_block_hash.patch770 bytes

Comments

#1

FYI this patch also applies to the 3.x branch (with a 7 line offset).

#2

Status:needs review» reviewed & tested by the community

Manual testing worked fine. I added a block from a view with a long name.
-> the variable_set is called
->goto admin/build/blocks again, no call to variable_set.

Code looks fine

#3

Priority:normal» critical

This causes a 1 second hit on every page view on a D6 site I have in dev, bumping to critical. Patch looks good and fixes the issue.

#4

+1

We have blocks in panel panes sitewide which cause hook_block('list') to be executed on every page. Because of this variable_set() in views_block('list') our variable cache is rendered useless causing a significant performance hit.

#5

We have blocks in panel panes sitewide which cause hook_block('list') to be executed on every page.

I'm not sure whether this is how panels should it be.

#6

Version:6.x-2.x-dev» 7.x-3.x-dev
Status:reviewed & tested by the community» patch (to be ported)

Fixed in 6.x-2.x and 6.x-3.x -- does not apply to 7.x but almost certainly needs to be fixed there as well.

#7

Status:patch (to be ported)» fixed

The patch did not applied because hook_block($op = 'list' got converted to hook_block_info

And commited.

#8

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here