Front page SQL tests show that the _homebox_can_view_block() function is getting called multiple times per HTTP request.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | homebox_can_view_block-caching-1261358-1.patch | 1.26 KB | gitesh.koli |
| #2 | homebox-cache-query-results-1213154-2.patch | 2.23 KB | uberhacker |
| #1 | homebox-cache-query-results-1213154-1.patch | 3.06 KB | uberhacker |
Comments
Comment #1
uberhacker commentedThis 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.
Comment #2
uberhacker commentedThis is a fix for the patch in comment #1 above. Testing and comments welcome.
Comment #3
gitesh.koli commentedPlease ignore this comment. Wrong post.
Comment #4
brianV commenteduberhacker: 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?
Comment #5
uberhacker commentedbrianV: Please ignore the first patch. The second patch is all you need. Thanks.
Comment #6
brianV commentedSo the patch in #2 is the one you want under consideration? Ignore #1 and #3?
Comment #7
attiks commentedPatch in #2 is working for me, improvement approximately 300-400ms
Comment #8
Matt-H commentedA D7 version of this patch can be found at http://drupal.org/node/1372406
Comment #9
roderikSorry, 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).
Comment #10
drummDrupal 6 is no longer supported. If this can be reproduced with Drupal 7, please re-open with details.