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

The admin /admin/search.php page is slow due to analytics + classloading size

    XMLWordPrintable

Details

    • MOODLE_35_STABLE
    • MOODLE_37_STABLE
    • MDL-64284-36_get_component_classes_cache
    • Hide

      1) Install some heavy plugins which add massive amounts of classes to the auto class loading list, eg tool_objectfs + local_aws

      2) Visit the admin search page, note the page performance is much slower. Do a ?PROFILEME to see the bottleneck

      3) Apply patch, re-test

       

      Show
      1) Install some heavy plugins which add massive amounts of classes to the auto class loading list, eg tool_objectfs + local_aws 2) Visit the admin search page, note the page performance is much slower. Do a ?PROFILEME to see the bottleneck 3) Apply patch, re-test  

    Description

      The admin page has become noticeably slower on big sites which have many plugins installed, especially plugins that have large numbers of autoloaded classes (eg the local_aws which pulls in a ton of libraries)

      Some profiling points towards the core_component::get_component_classes_in_namespace being either slow or just called too much (eg on my dev box it is called 505 times, and takes 1.5 seconds wall clock time).

      But I think the root cause is actually the core_analytics\manager::get_analytics_classes which hammers this repeatedly with very similar calls searching for similar classes eg 'time_splitting'. Each time it is searching the entire list of classes. If I temp comment out the analytics code then the admin search is 1.5 seconds or 3x times faster.

      I'm thinking a way to speed is up is here:

      https://github.com/moodle/moodle/blob/master/analytics/classes/manager.php#L613

      Search for just all 'analytics' classes, statically caching that much smaller list, and then search that for the $element class.

       

       

      Attachments

        Issue Links

          Activity

            People

              tom_d Tom Dickman
              brendanheywood Brendan Heywood
              David Monllaó David Monllaó
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 35 minutes
                  35m

                  Clockify

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