-
Bug
-
Resolution: Fixed
-
Critical
-
4.0.5, 4.1
-
MOODLE_400_STABLE, MOODLE_401_STABLE
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MDL-76174_401 -
-
2
-
Team Hedgehog Sprint 1.2, Team Hedgehog 2023 Sprint 2.2
In MDL-73549 a button was introduced so that users with the right to create new courses got a button to do so.
A function core_course_category::get_nearest_editable_subcategory() was introduced but this function has severe impact on performance if you have many course categories. On our 10.000+ course categories site a student would see 20 seconds load times. (Running on 5 Nginx-servers and Redis-cachgin)(.
The function apperently traverser the entire course category structure in a very inefficient way where it continues to loop the categories until a category with "create course" capabilities is found.
This is especially critical since the majority of users (students) will not have any course creator rights and hence Moodle has to look though all course categories.
Steps to reproduce:
- Turn on profiling
- Create a large number of categories (10.000 +) in diffent levels.
- Log as a user without any rights to create courses (normally a student)
- Oberserve the call grahp
Below is a profiling on a site with 2200 course categories. I have also attached the call graph.
- caused a regression
-
MDL-81304 Still very poor performance on my/courses.php
-
- Open
-
-
MDL-78657 Regression caused by MDL-76174 - "fix" incredibly slow on large site
-
- Closed
-
-
MDL-78618 Very poor performance on my/courses.php
-
- Closed
-
- has been marked as being related by
-
MDL-78370 Course Overview Block Performance
-
- Closed
-
- is a regression caused by
-
MDL-73549 Users with course management or creation permission at category level should see 'Manage courses' or 'New course' on My courses page
-
- Closed
-
- is duplicated by
-
MDL-75786 Rendering page /my/courses.php takes 20s for no admin user
-
- Closed
-
-
MDL-76830 Course overview block slow for site with large number of course categories
-
- Closed
-