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
    • Rank:
      17415

      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.

        Activity

        Hide
        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
        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 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 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
        Sam Hemelryk added a comment -

        Thanks Marina, this has been integrated now.

        Cheers
        Sam

        Show
        Sam Hemelryk added a comment - Thanks Marina, this has been integrated now. Cheers Sam
        Hide
        Petr Škoda added a comment -

        tested, thanks!

        Show
        Petr Škoda added a comment - tested, thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: