Skip to content
  • Adam Olley's avatar
    MDL-58160 coursecat: Use set_many to populate category cache · b3e4fbc0
    Adam Olley authored
    When the course category cache needs to be repopulated, two entries are added
    to the cache for each category. In core this is currently done in a for-loop,
    resulting in N set calls to the cache (where N is twice the number of
    categories in Moodle).
    
    This change switches that code to using a single set_many cache call instead,
    which makes this an O(1) operation instead of O(N).
    
    For a site with say, 1000 categories, this results in only 1 set call to the
    cachestore instead of 2000.
    b3e4fbc0