-
Sub-task
-
Resolution: Fixed
-
Minor
-
2.6, 2.9
-
MOODLE_26_STABLE, MOODLE_29_STABLE
-
MOODLE_30_STABLE
-
capabilities_cache
-
Hello,
There is a comment about the "capabilities" list in accesslib.php : //TODO: MUC - this could be cached in shared memory, it would eliminate 1 query per page
While profiling and benchmarking, I noticed that although 1 query could seem small, optimizing it leads to a 2%~3% page load time improvement with apc user cache, because this query returns all rows of a 500 rows table.
Here is a patch : http://poinsart.com/ftp/ste/moodle-profiling/moodle-speedup2-260dev-20131007.patch
It adds a "cachedef_cap" entry at the end of the cache definition list in the admin->plugins->caching screen, associating a fast cache to it should give the measurable performance benefit I mentioned above, hopefully without any other visible effects.
Limits :
- I did not add the string to describe the cache definition name in the admin screen
- I'm not really sure whether it's correctly cleared when necessary (i.e. during a moodle upgrade or a plugin install ?), if anyone knows how to test that...
I preferred to create a separate ticked even if there already is https://tracker.moodle.org/browse/MDL-34242 , I found it quite vague.
Disclaimer : this is the first time I'm attempting to contribute and I'm still unfamiliar with moodle inner working so don't hesitate to point out any problems in my suggestion