Closed (fixed)
Project:
Menu Per Role
Version:
6.x-1.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Jun 2010 at 17:58 UTC
Updated:
2 Nov 2013 at 00:30 UTC
Jump to comment: Most recent
Hi! The current version of this module makes a *lot* of database queries -- potentially several for every menu item you have on every page load. Although these are small queries, they add up in time.
I've attached a patch that should only make the queries once per each page load using a static variable for caching. At least at my site, this has made it slightly faster.
HTH,
Ricky
| Comment | File | Size | Author |
|---|---|---|---|
| menu_per_role_static_vars_patch.txt | 2.28 KB | pukku |
Comments
Comment #1
AlexisWilke commentedGood point. 8-)
Thank you for the patch!
I actually went ahead and optimized even more since we read the same table twice with the hide from X and show to Y...
So, I cache everything in a single function where I added a parameter to know whether I want the rids or hrids.
It is applied to the 1.x-dev version.
Thank you.
Alexis