-
Improvement
-
Resolution: Fixed
-
Major
-
3.0.5, 3.0.6, 3.1, 3.1.1, 3.1.2
-
MOODLE_30_STABLE, MOODLE_31_STABLE
-
MOODLE_33_STABLE
-
master_
MDL-56808 -
Moderate
-
Hello all,
I work for the CNED in France. They have a big Moodle platform with a lot of SCORM packages.
Ultimately they have worked on a bunch of HTML5 SCORM 1.2 packages.
All those package pages have navigation buttons at the bottom. When someone click on next or previous button, the package commit to save the progression, time, ... and load a new page.
The packages have dizains of pages so the users navigate heavily between the pages. It has been reported to use that changing pages could take more than 5s on latest firefox or chrome. The performance issue being much more visible in Chrome.
I first though it was a server performance problem but quickly understood that it wasn’t. The commit (POST to ajax_save_item.php) takes less than 300ms.
I thus began to debug with the firefox javascript profiler.
As you can see in my first screenshot (screenshot_scorm_wo_opti.png), it is the CollectData function in the scorm12.js that takes 32% of the execution time. And the most important, the other process won't begin while this one is not finished. The user has thus to wait 2 to 5 s to open the next page.
We inspected the function and saw that it was calling a few eval. We thus simply replace those evals (like in the patch attached) and ran the profiler again.
As you can see in the screenshot named screenshot_scorm_with_opti.png, the CollecData function doesn't appear anymore and the whole process is a lot faster. Use has now to wait less than a second.
We have tested and tracking still seems to work. I think I didn't break anything but can't be sure.
Question are :
- Is there a reason for those eval in CollectData function?
- Is it dangerous to replace them?
Thanks in advance for your time.
Bets regards.
Noel Dieschburg
- has a non-specific relationship to
-
MDL-51018 SCORM convert php eval() to use EvalMath Class
- Closed