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

Files: 
CommentFileSizeAuthor
menu_per_role_static_vars_patch.txt2.28 KBpukku

Comments

Status:Closed (fixed)» Fixed

Good 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

Status:Active» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Fixed» Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.