Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40538

cachestore_static, cachestore_session: array_key_exists slow

    XMLWordPrintable

Details

    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • Hide

      Before application (or revert if possible)

      1. site administration > settings > plugins > caching > test performance
      2. Run performance test with 10000 unique queries. Note the times for "session" and "static request" caches

      Apply Patch/ensure it's installed

      1. site administration > settings > plugins > caching > test performance
      2. Run performance test with 10000 unique queries. Note the times for "session" and "static request" caches

      3. Compare times

      4. Run phpunit tests.

      Please note that performance improvements will vary on the platform you test this on. For example time() performance varies depending on system architecture, eg VM or physical. array_key_exists will depending on CPU caches and may other things.

      On KVM on AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ gave a 100x increase for hits on static cache.

      Show
      Before application (or revert if possible) 1. site administration > settings > plugins > caching > test performance 2. Run performance test with 10000 unique queries. Note the times for "session" and "static request" caches Apply Patch/ensure it's installed 1. site administration > settings > plugins > caching > test performance 2. Run performance test with 10000 unique queries. Note the times for "session" and "static request" caches 3. Compare times 4. Run phpunit tests. Please note that performance improvements will vary on the platform you test this on. For example time() performance varies depending on system architecture, eg VM or physical. array_key_exists will depending on CPU caches and may other things. On KVM on AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ gave a 100x increase for hits on static cache.

    Description

      array_key_exists can be slow and can add substantial overhead to calls.

      time() can be an expensive call on some platforms.

      There calls should be out of the critical path in the static cache.

      Attachments

        Issue Links

          Activity

            People

              mr-russ Russell Smith
              mr-russ Russell Smith
              Sam Hemelryk Sam Hemelryk
              Damyon Wiese Damyon Wiese
              Michael de Raadt Michael de Raadt
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Sep/13