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

Improve speed of admin/blocks.php by combining db counts

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_402_STABLE
    • MDL-75667-master
    • Easy
    • Hide

      As this is a performance tracker we want a comparison before and after the patch, ideally on a very large site with lots of block instances.

      Before change

      1. Turn on $CFG->perfdebug
      2. Load admin/blocks.php and load it a couple times to let everything warm up and stabilize
      3. Note the number of reads in the footer eg DB reads/writes: 209/0
      4. Note the total page load time, eg 10 seconds

      After change

      1. Checkout fixed branch
      2. Load admin/blocks.php and load it a couple times to let everything warm up and stabilize
      3. Confirm the number of read has gone down dramatically DB reads/writes: 114/0
      4. Confirm the total page time is now lower eg

       

      Show
      As this is a performance tracker we want a comparison before and after the patch, ideally on a very large site with lots of block instances. Before change Turn on $CFG->perfdebug Load admin/blocks.php and load it a couple times to let everything warm up and stabilize Note the number of reads in the footer eg DB reads/writes: 209/0 Note the total page load time, eg 10 seconds After change Checkout fixed branch Load admin/blocks.php and load it a couple times to let everything warm up and stabilize Confirm the number of read has gone down dramatically DB reads/writes: 114/0 Confirm the total page time is now lower eg  

      On a large this this page can be slow, 10+ seconds to load

      /admin/blocks.php

      It is looking up all block types, then doing a db count call for each row. All of these could be combined into a single sql grouped by type and it should be an order of magnitude quicker.

            farhan6318 Farhan Karmali
            brendanheywood Brendan Heywood
            Brendan Heywood Brendan Heywood
            Paul Holden Paul Holden
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 hours, 10 minutes
                7h 10m

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