-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
2.3.2
-
MOODLE_23_STABLE
I've been following some of the different JavaScript performance issues including http://tracker.moodle.org/browse/MDL-34328 and couldn't find one specifically for the issue I'm having.
When users are enrolled in lots of courses some JavaScript that works on the My Courses section of the navigation block takes an awful long time to do what it needs to do and causes the browser to become unresponsive. Eventually the "Stop running this script" message box appears. I've seen this behaviour in both IE8 and IE9.
I've done some rudimentary profiling of the code in blocks/navigation/yui/navigation/navigation.js and found that TREE.initializer seems to be causing the slow down, specifically this for loop:
// Establish each expandable branch as a tree branch.
|
for (var i in expansions) {
|
new BRANCH({
|
tree:this,
|
branchobj:expansions[i],
|
overrides : {
|
expandable : true,
|
children : [],
|
haschildren : true
|
}
|
}).wire();
|
M.block_navigation.expandablebranchcount++;
|
}
|
I have a user enrolled in about 950 courses where this section of JavaScript code running on IE8 on a reasonably powerful machine can take 38 seconds to run. Even for a user enrolled in a more sensible number of courses like 25, this section of code can take almost a whole second to run which would be starting to have a noticeable impact on the user experience. Obviously the navigation block appears in lots of places throughout Moodle so as a result the slow down can have a big impact on a user's overall Moodle experience.
I've also seen a similar level of unresponsiveness experienced by users viewing the profile of another user that is enrolled in a large number of courses, probably for a similar reason.
- has a non-specific relationship to
-
MDL-35304 Navigation block showing section names in week view causes slow down
-
- Closed
-
-
MDL-39205 User profile page runs out of memory when user is enrolled in a lot of courses
-
- Closed
-
-
MDL-36016 Redesign the navigation and setting blocks HTML structure
-
- Closed
-
- will be (partly) resolved by
-
MDL-33017 Reduce size of Navigation bar when in a course
-
- Closed
-