Uploaded image for project: '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

          Attachments

            Activity

            Hide
            ashleyholman Ashley Holman added a comment -

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

            Show
            ashleyholman Ashley Holman added a comment - Hi Petr, are you the one to assign 2.0 performance issues to? Ash
            Hide
            skodak 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
            skodak 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
            stronk7 Eloy Lafuente (stronk7) added a comment -

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

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

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

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

            Wrong issue sorry

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

            PULL request submitted.

            Show
            dongsheng Dongsheng Cai added a comment - PULL request submitted.
            Hide
            dougiamas 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
            dougiamas 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 Dongsheng Cai added a comment -

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

            Show
            dongsheng Dongsheng Cai added a comment - Added empty() section to check if $CFG->numcoursesincombo exists
            Hide
            tsala 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
            tsala 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:
                  Fix Release Date:
                  5/May/11