Front page SQL tests show that the _homebox_can_view_block() function is getting called multiple times per HTTP request.

Comments

uberhacker’s picture

This patch improves performance by setting a static variable and caching the query results. Please do not use this patch. Use the patch in comment #2. This patch has an error in the static variable assignment and does not account for block deltas in the cache.

uberhacker’s picture

This is a fix for the patch in comment #1 above. Testing and comments welcome.

gitesh.koli’s picture

Please ignore this comment. Wrong post.

brianV’s picture

Status: Patch (to be ported) » Needs work

uberhacker: Instead of giving this as a patch and a patch to apply to the code patched with the first patch, can you roll these into a single patch that can be easily reviewed?

uberhacker’s picture

brianV: Please ignore the first patch. The second patch is all you need. Thanks.

brianV’s picture

So the patch in #2 is the one you want under consideration? Ignore #1 and #3?

attiks’s picture

Version: 6.x-3.0-beta2 » 6.x-3.x-dev
Status: Needs work » Reviewed & tested by the community

Patch in #2 is working for me, improvement approximately 300-400ms

Matt-H’s picture

A D7 version of this patch can be found at http://drupal.org/node/1372406

roderik’s picture

Status: Reviewed & tested by the community » Needs work

Sorry, I don't see the use for cache_get() - and from looking at this patch, I think that multiple SQL calls are still being made. See #1372406-2: Cache query results in _homebox_can_view_block() (D7 version).

drumm’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Drupal 6 is no longer supported. If this can be reproduced with Drupal 7, please re-open with details.