Moodle
  1. Moodle
  2. MDL-24877

Performance issue for front page "Combo" list for site admins

    Details

    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      If you edit the front page settings and change frontpageloggedin to contain a "Combo" item, the administrator will experience very slow loading of the /index.php page if the site has many courses.

      Example: site with 6000 courses taking 2 minutes to load /index.php and placing high load on the database server.

      The "Courses list" front page item does not suffer this problem.

      The relevant code seems to be:

      echo $OUTPUT->heading(get_string('courses'), 2, 'headingblock header');
      $renderer = $PAGE->get_renderer('core','course');
      echo $renderer->course_category_tree(get_course_category_tree());

      Could that course tree be changed to not show all courses for admins?

        Gliffy Diagrams

          Activity

          Hide
          Ashley Holman added a comment -

          Hi Petr, are you the one to assign 2.0 performance issues to? Ash

          Show
          Ashley Holman added a comment - Hi Petr, are you the one to assign 2.0 performance issues to? Ash
          Hide
          Petr Skoda added a comment -

          Sam: did you work on the refactoring of this in 2.0?

          Yes, it looks like I will be responsible for perf now, the current plan is to get 2.0 working, then concentrate on the perf after 2.0 release.
          Thanks for the report.

          Show
          Petr Skoda added a comment - Sam: did you work on the refactoring of this in 2.0? Yes, it looks like I will be responsible for perf now, the current plan is to get 2.0 working, then concentrate on the perf after 2.0 release. Thanks for the report.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Sending to stable backlog for performance sprint. Thanks for the report!

          Show
          Eloy Lafuente (stronk7) added a comment - Sending to stable backlog for performance sprint. Thanks for the report!
          Hide
          Sam Hemelryk added a comment -

          Marking as resolved as the last subtask MDL-25791 is marked as resolved.

          Show
          Sam Hemelryk added a comment - Marking as resolved as the last subtask MDL-25791 is marked as resolved.
          Hide
          Sam Hemelryk added a comment -

          Wrong issue sorry

          Show
          Sam Hemelryk added a comment - Wrong issue sorry
          Hide
          Dongsheng Cai added a comment -

          PULL request submitted.

          Show
          Dongsheng Cai added a comment - PULL request submitted.
          Hide
          Martin Dougiamas added a comment -

          Some language string changes:

          $string['numcoursesincombo'] = 'Maximum number of courses in combo list';

          $string['numcoursesincombo_help'] = 'The combo list doesn\'t work well with large numbers of courses. When the total number of courses in the site is higher than this setting then a link to the dedicated course listing will be shown instead of trying to display all the courses on the front page.';

          $string['maxnumcoursesincombo'] = 'Browse <a href="{$a->link}">{$a->numberofcourses} courses</a>.';

          Show
          Martin Dougiamas added a comment - Some language string changes: $string ['numcoursesincombo'] = 'Maximum number of courses in combo list'; $string ['numcoursesincombo_help'] = 'The combo list doesn\'t work well with large numbers of courses. When the total number of courses in the site is higher than this setting then a link to the dedicated course listing will be shown instead of trying to display all the courses on the front page.'; $string ['maxnumcoursesincombo'] = 'Browse <a href="{$a->link}">{$a->numberofcourses} courses</a>.';
          Hide
          Dongsheng Cai added a comment -

          Added empty() section to check if $CFG->numcoursesincombo exists

          Show
          Dongsheng Cai added a comment - Added empty() section to check if $CFG->numcoursesincombo exists
          Hide
          Helen Foster added a comment -

          Ashley, thanks for your report and Dongsheng, thanks for fixing. The fix is available in this week's 2.0.2+.

          Show
          Helen Foster added a comment - Ashley, thanks for your report and Dongsheng, thanks for fixing. The fix is available in this week's 2.0.2+.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: