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

Speeding up course listings on large sites

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.5.2
    • 2.5.1
    • Course
    • MOODLE_25_STABLE
    • MOODLE_25_STABLE
    • wip-MDL-41114-master
    • Hide

      Before test: Create several (the more the better) course categories

      Repeat on branch with the patch and without (revert the commit):

      1. Purge all caches (in another window)
      2. Open /course/manage.php, make sure everything is displayed correctly, copy page performance information
      3. Refresh the page, copy page performance information
      4. Purge all caches (in another window)
      5. Open one category, make sure the list to jump to another category is populated correctly, copy page performance information
      6. Refresh the page, copy page performance information
      7. Purge all caches
      8. Open admin settings page: /admin/settings.php?section=enrolsettingsdatabase, make sure categories list is populated correctly, copy page performance information
      9. Refresh the same settings page, copy page performance information

      Performance should be improved, especially the number of DB queries.
      Testing only on 2.5 is enough, this code was not modified in master and is completely the same.

      Show
      Before test: Create several (the more the better) course categories Repeat on branch with the patch and without (revert the commit): Purge all caches (in another window) Open /course/manage.php, make sure everything is displayed correctly, copy page performance information Refresh the page, copy page performance information Purge all caches (in another window) Open one category, make sure the list to jump to another category is populated correctly, copy page performance information Refresh the page, copy page performance information Purge all caches Open admin settings page: /admin/settings.php?section=enrolsettingsdatabase, make sure categories list is populated correctly, copy page performance information Refresh the same settings page, copy page performance information Performance should be improved, especially the number of DB queries. Testing only on 2.5 is enough, this code was not modified in master and is completely the same.

      During some performance testing of courses/coursecat listings I found several bugs that significantly decrease performance in case of large amount of course categories.

      • function coursecat::make_categories_list() does not use retrieved contexts and has to query them again.
      • /course/manage.php uses field coursecat::$coursecount that was not fetched when retrieving the course category children.
      • make_categories_options() unnecessary queries the course categories table again.

      Both fixes are one-line so I submit them in one issue.

            marina Marina Glancy
            marina Marina Glancy
            Damyon Wiese Damyon Wiese
            Sam Hemelryk Sam Hemelryk
            Jason Fowler Jason Fowler
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.