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

Improve move_courses() Performance

    Details

    • Testing Instructions:
      Hide

      using Site Administration->Courses->Add edit courses

      1. Create several courses and several categories
      2. Try to move one/several courses from one category to another

      Show
      using Site Administration->Courses->Add edit courses 1. Create several courses and several categories 2. Try to move one/several courses from one category to another
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
      git@github.com:marinaglancy/moodle.git
    • Pull Master Branch:
      wip-MDL-27756-master

      Description

      move_courses() does a lot of things in a wasteful way:

      • Not reusing information
      • Repeating steps

      The attached patch (mdl_move_courses_performance.diff) attempts to minimize the waste.

        Gliffy Diagrams

          Activity

          Hide
          salvetore Michael de Raadt added a comment -

          Thanks for suggesting this.

          I've put it on our backlog and we'll try to get to it as soon as we can.

          Show
          salvetore Michael de Raadt added a comment - Thanks for suggesting this. I've put it on our backlog and we'll try to get to it as soon as we can.
          Hide
          marina Marina Glancy added a comment -

          The improvement is not really huge. The difference is probably noticed only in case of large number of moved courses

          1. New category context is retrieved only once, instead of every time for each moved course.
          2. Only the changed fields in course db table are updated

          Show
          marina Marina Glancy added a comment - The improvement is not really huge. The difference is probably noticed only in case of large number of moved courses 1. New category context is retrieved only once, instead of every time for each moved course. 2. Only the changed fields in course db table are updated
          Hide
          samhemelryk Sam Hemelryk added a comment -

          Thanks Marina, this has been integrated now.

          Cheers
          Sam

          Show
          samhemelryk Sam Hemelryk added a comment - Thanks Marina, this has been integrated now. Cheers Sam
          Hide
          skodak Petr Skoda added a comment -

          tested, thanks!

          Show
          skodak Petr Skoda added a comment - tested, thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                1/Aug/11