-
Improvement
-
Resolution: Fixed
-
Critical
-
3.0.2
-
MOODLE_30_STABLE
-
MOODLE_31_STABLE
-
1. serialize and unserialize are used widely to manage objects in the cache. There are multiple layers of completing this resulting in wasted cycles.
2. There are a large amount of function calls to check the if and how something should be unreferenced. This could be simplified and reduced.
3. most stores already store data in a serialized fashion, so when it comes back from the store it's already had references resolved. This can be told to the loader and be a performance win.
4. static acceleration is designed to be write low and read high. However it does all the heavy lifting for dereferencing on a get call. Objects could be serialized on set if required and just a single unserialize on loading. This will reduce the serialize or clone overhead when using the static cache.
5. uses_simple_data should be trusted by the loader to know unreference is never required, including from the static acceleration. This can be determined without nesting into the unref function.
6. static acceleration delete does an array_search, when the keys are available and an isset() and unset() would be sufficient to remove entries.
7. static acceleration does not need keys parsed as it's stored on a per cache basis.
These changes can provide a significant performance improvement for complex structures and some improvement for simple data cases. In cases where simpledata is used with static acceleration but the simpledata is an object, there can be good gains because in the current structure static acceleration still did function calls when simple_data was set.
Overall see the basic attached file that tests the runtime of a complex array of objects (databasemeta) and also does the same for simple_data and simple_keys by testing get_string. Those two formed the basis for the performance improvements.
Basic loading of pages has not seen significant performance improvements for smaller faster pages. However for pages that complete lots of databasemeta lookups, there are much bigger gains.
- has been marked as being related by
-
MDL-53213 Make databasemeta cache a simpledata cache and improve performance
-
- Closed
-
- has to be done after
-
MDL-53206 get_many does not dereference objects
-
- Closed
-
- is blocked by
-
MDL-53206 get_many does not dereference objects
-
- Closed
-
- will help resolve
-
MDL-48856 Postgresql driver performance tuning
-
- Closed
-