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

Improving Unit Test Time by Reducing Overhead

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Peer review in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6
    • Fix Version/s: None
    • Component/s: Performance, Unit tests
    • Labels:

      Description

      So I've been running unit tests over and over and I felt bad asking travis to run the test suite for me, but it's quite a bit faster than my system. So I took a look to see what my system was doing that was taking so long to run these unit tests.

      The item that stood out was that the database was being reloaded from scratch over and over (which I understand). But each row was being added individually, which surprised me because I know that Moodle has database functions for bulk inserts (when supported with fallback to single inserts). So I wrote a patch that uses it. For me, this is somewhere between a 3% and 10% reduction in total time, not earth-shattering, but I wondered if anyone was interested.

        Attachments

          Activity

            People

            • Assignee:
              jrchamp Jonathan Champ
              Reporter:
              jrchamp Jonathan Champ
              Participants:
              Component watchers:
              Matteo Scaramuccia, Jake Dallimore, Jun Pataleta, Ryan Wyllie, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: