The code in plugins/context_reaction_block.inc makes a lot of calls to system_region_list. The region list should be cached once.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | context.patch | 2.69 KB | JamesSharpe |
The code in plugins/context_reaction_block.inc makes a lot of calls to system_region_list. The region list should be cached once.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | context.patch | 2.69 KB | JamesSharpe |
Comments
Comment #1
JamesSharpe commentedSomething like the attached patch to context_reaction_block fixes this. I'm running this on my site and it seems to fix the performance issues.
Comment #2
MixologicThis is sortof a dupe of this: https://drupal.org/node/1873450 . but not quite. One fixes it in core, the other fixes it in context.
Comment #3
joelcollinsdc commentedFWIW, (i'm the creator of the other issue), I think this should be fixed in context instead of core. (Unless a ton of other modules abuse that function, which I am not aware of...)
Comment #4
tekante commentedFix applied implemented caching in context reaction block. Used a different pattern than the suggested patch to allow for ease of insertion (and hopefully later removal when #1873450: Caching results of system_region_list lands) and to reduce need for duplicated if var set checks. Thanks for the bug report and suggested patch.
Comment #5
MixologicI looked this over, pulled it in and tested it. Works awesome. #1873450 may never make it into core, but this is likely the only contrib that suffers from it.