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

Performance and usability improvements in class cm_info

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide

      Must be no regressions and performance improvement in the following cases:

      1. Enable completion and conditional availability (otherwise there are no extra queries and therefore no performance improvements)
      2. Make course display one section per page
      3. If section A has activities with conditional availability and user views section B, the availability of unshown activities is not calculated.
      4. Same with viewing /my/ page - you should see the performance improvement, especially if MAX_MODINFO_CACHE_SIZE is less than number of courses displayed on the page.
      5. Same with overview pages mod/xxxx/index.php
      Show
      Must be no regressions and performance improvement in the following cases: Enable completion and conditional availability (otherwise there are no extra queries and therefore no performance improvements) Make course display one section per page If section A has activities with conditional availability and user views section B, the availability of unshown activities is not calculated. Same with viewing /my/ page - you should see the performance improvement, especially if MAX_MODINFO_CACHE_SIZE is less than number of courses displayed on the page. Same with overview pages mod/xxxx/index.php
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Epic Link:
    • Pull Master Branch:
      wip-MDL-41192-master
    • Sprint:
      BACKEND Sprint 4

      Description

      Classes cm_info should not perform any calculations/requests in constructor, all properties should be read-only and those that need calculations have getters methods so they are calculated on the first request only.

      What it saves: when we call get_fast_modinfo() for the whole course but only actually need one activity (or only activities in one sections, activities of particular type, etc.), the other activities' visibility is not calculated. At the moment it can be expensive if conditions or groups are used.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marina Marina Glancy
              Reporter:
              marina Marina Glancy
              Peer reviewer:
              Rajesh Taneja
              Integrator:
              Sam Hemelryk
              Tester:
              Rossiani Wijaya
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13