Closed (won't fix)
Project:
OG User Roles
Version:
5.x-3.3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
16 Oct 2008 at 08:26 UTC
Updated:
5 Dec 2009 at 17:43 UTC
Do not clear the cache every page load!
At the moment every page load the cache is cleared if you use 'og_user_roles_clear_cache_value' which is almost neccesary in all installs. This patch only cleares the cache when somethings has changed.
Do not load the user in your init hook()!
The organic groups module does a user_load on the current user in init. There for the data of the current user is already loaded.
Do not reload the roles if no group nid was found!
When we do not have a organic group we do not need to update the roles.
| Comment | File | Size | Author |
|---|---|---|---|
| og_user_roles_performance.patch | 3.89 KB | R.Muilwijk |
Comments
Comment #1
somebodysysop commentedThank you very much for the contribution. I do wish to improve the performance of this module. Because this involves modification of the core OGUR functions, I'm sure you understand that I have to proceed with extreme caution.
I'm trying to follow your code changes and I think I understand most of it. I am not really clear on this section:
Could you please elaborate just a bit on what's going on here? Am I correct in my assumption that you don't really care what the roles are, you are just looking for some indication that they've changed?
Also, are you currently using the module with these new changes?
Comment #2
R.Muilwijk commentedWell I think it is a nice addition (and needed for the patch in hook_init) to be able to see what roles have been added to a user. So this is a global variable (could be a static function get/set too if you think thats prettier) which holds all the uid's and which roles have been added to that uid.
I needed the module for a client of ours but noticed the cache being cleared alot. This was quite intensive so I wrote this patch to work around and the writes / clears to the cache lowered down alot.
Comment #3
sunAfter the rise of the rewritten OGUR 4.x for Drupal 6, in which many unrelated features of OGUR were removed, and nearing a release of Drupal 7, I'm closing down old issues.