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

comments lib should cache assign class

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0
    • 3.11, 3.11.2
    • Assignment
    • MOODLE_311_STABLE
    • MOODLE_400_STABLE
    • Hide
      Before the patch
      1. Check out a version before this patch (e.g. "git checkout 1a7f8e7eed3")
      2. Go to admin > development > debugging and turn perfdebug on. Or if using MDK: "mdk run mindev"
      3. Create a test course that includes at least 10 participants
      4. Create an assignment with either "Online text" or "File submissions"
      5. Enter the assignment and hit the "View all submissions" link to view the grading page.
      6. Grade at least 5 students:
        1. On the grading page, enter a grade
        2. Save changes
        3. You'll see a "Comments" area (not the "Feedback comments"). Expand the comments area.
        4. Enter a comment and save the changes and do the same for the other students to be graded.
      7. After grading the students, press "View all submissions"
      8. Reload the assignment grading page about two times. Take note of the "DB reads" value at the bottom of the page.
      Apply the patch
      1. Check out the version with this patch applied.
      2. Reload the assignment grading page a couple of times. Take note of the DB reads value at the bottom of the page.
      3. Confirm that they are lower than the number before the patch.
      4. Create another assignment instance
      5. Grade some students and add some comments.
      6. Confirm that the grading table shows the comments correctly for the students.
      7. Go to the first assignment instance
      8. Confirm that the grading table shows the comments correctly for the students.
      Show
      Before the patch Check out a version before this patch (e.g. " git checkout 1a7f8e7eed3 ") Go to admin > development > debugging and turn perfdebug on. Or if using MDK: " mdk run mindev " Create a test course that includes at least 10 participants Create an assignment with either "Online text" or "File submissions" Enter the assignment and hit the "View all submissions" link to view the grading page. Grade at least 5 students: On the grading page, enter a grade Save changes You'll see a " Comments " area (not the " Feedback comments "). Expand the comments area. Enter a comment and save the changes and do the same for the other students to be graded. After grading the students, press " View all submissions " Reload the assignment grading page about two times. Take note of the "DB reads" value at the bottom of the page. Apply the patch Check out the version with this patch applied. Reload the assignment grading page a couple of times. Take note of the DB reads value at the bottom of the page. Confirm that they are lower than the number before the patch. Create another assignment instance Grade some students and add some comments. Confirm that the grading table shows the comments correctly for the students. Go to the first assignment instance Confirm that the grading table shows the comments correctly for the students.

      when viewing the grading page, various functions instantiate the assign class without passing the coursemodule and course - big offenders include are:

      • assignsubmission_comments_comment_validate
      • assignsubmission_comments_comment_permissions 

      On a page with 1000 users being displayed at once, those 2 functions add 6 seconds to the page load and approx 10,000 db reads, we should cache the $assign class so that we only request it once.

            danmarsden Dan Marsden
            danmarsden Dan Marsden
            Sujith Haridasan Sujith Haridasan
            Jun Pataleta Jun Pataleta
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 15 minutes
                1h 15m

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