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

cachestore_static, cachestore_session: array_key_exists slow

    Details

    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    9/Sep/13