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

Improving Unit Test Time by Reducing Overhead

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.6
    • Performance, Unit tests

      So I've been running unit tests over and over and I felt bad asking CIs 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.

            jrchamp Jonathan Champ
            jrchamp Jonathan Champ
            Ilya Tregubov Ilya Tregubov
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h

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