Attached patch adds caching for the results of all *_load_all() functions.
Panels executes these functions multiple times without an argument on a single page request, so by statically caching the results, this is a noticeable performance improvement.
I didn't cache the results of panels_page_load_all(), since that is usually invoked only once per request.
oh wait... latest dev already includes something like that. However, that contains some bugs.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | panels-DRUPAL-5--2.cache_.patch | 12.46 KB | sun |
| #4 | panels-DRUPAL-5--2.cache_.patch | 12.54 KB | sun |
| #2 | panels-DRUPAL-5--2.cache_.patch | 12.49 KB | sun |
Comments
Comment #1
merlinofchaos commentedNo patch attached.
Comment #2
sunFixes:
- Variable spelling mistake in panels_views_load_all()
- Use isset() instead of array_key_exists(), which is cleaner and faster
- Use early-outs instead of indented function bodys.
Comment #3
merlinofchaos commentedarray_key_exists is used why:
This prevents it from trying to recache panels it did not find.
Comment #4
sunReverted isset() to array_key_exists() where required.
Comment #5
sunRe-rolled patch.
Contains only coding-style fixes now, thus RTBC.
Comment #6
panchoThe patch did contain more than coding-style fixes: in panels_mini_load_all(), isset() is replaced by array_key_exists(). This is correct though. Nice stuff, thanks!
If you had separated out the variable spelling mistake in panels_views_load_all() as a critical bug, I would have found it and saved some time...
Tested and committed: http://drupal.org/cvs?commit=119623
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.