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

Improve performance for making test courses.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.0.6, 3.1.2
    • Component/s: Performance
    • Labels:
    • Testing Instructions:
      Hide
      All branches
      • Verifying the changes to the random_bytes function.
        In most cases you will be running PHP with either openssl or PHP7. You have 2 options; either install a PHP5.6 without openssl or just comment out the code.

      For commenting out the code you need to lib/moodlelib.php:7800 (The closing brace on the $length <=0 test) is the start. Then lib/moodlelib.php:7814 (The closing brace on the function_exists() test).

      • Run the phpunit tests and ensure they all pass.

      NOTE: The performance of maketestcourse.php is only improved when openssl or random_bytes is accessible. See the comments about performance results to show that. In nearly all cases users will have one of these functions for 3.2. And ssl is a recommended inclusion. Performance changes only need be tested on master. Only the random_bytes_emulate fixes were backported.

      Master only
      • Using stable master, make an (M) test course

        php admin/tool/generator/cli/maketestcourse.php --shortname=L4.2 --size=M
        

      • Using integration master, make an (M) test course
      • Verify the timing is faster, especially for file creation. Others may be faster, depending on the database used, PostgreSQL has problems with large transactions and removing the transaction made assignment creation faster.
      • For the enthusiastic, do the same for (L).

      When creating (L) nearly all the time will be spent creating assignments. This is due to the large number of regrading queries that are sent.

      Show
      All branches Verifying the changes to the random_bytes function. In most cases you will be running PHP with either openssl or PHP7. You have 2 options; either install a PHP5.6 without openssl or just comment out the code. For commenting out the code you need to lib/moodlelib.php:7800 (The closing brace on the $length <=0 test) is the start. Then lib/moodlelib.php:7814 (The closing brace on the function_exists() test). Run the phpunit tests and ensure they all pass. NOTE: The performance of maketestcourse.php is only improved when openssl or random_bytes is accessible. See the comments about performance results to show that. In nearly all cases users will have one of these functions for 3.2. And ssl is a recommended inclusion. Performance changes only need be tested on master. Only the random_bytes_emulate fixes were backported. Master only Using stable master, make an (M) test course php admin/tool/generator/cli/maketestcourse.php --shortname=L4.2 --size=M Using integration master, make an (M) test course Verify the timing is faster, especially for file creation. Others may be faster, depending on the database used, PostgreSQL has problems with large transactions and removing the transaction made assignment creation faster. For the enthusiastic, do the same for (L). When creating (L) nearly all the time will be spent creating assignments. This is due to the large number of regrading queries that are sent.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull Master Branch:

      Description

      *Creating test files uses a slow method for generating random bytes.
      *Gradebook update is very slow on (L) courses and larger.

      Test file creation can be made much much faster, Gradebook grade_item updates should be able to be fast when there aren't any student enrolments in the course, however that has not been tackled as part of this change.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Sep/16