Question A: Does the Moodle core implementation of custom_corners bring advantages over a JavaScript implementation?
Question B: Does the Moodle implementation need optimisation?
For this test I implemented a JavaScript version of custom_corners with the same CSS and graphics as the Moodle implementation.
Comparison of the Moodle implementation and the JavaScript implementation of custom corners (CC):
Computers: MacBook 2GHz Intel Dual Core and 1.8 GHz AMD PC
Browser: Firefox 2.0.12, IE7 on the PC
Times taken in a Moodle course page with the Firefox YAHOO YSLOW extension are averages of many repetitions.
Course reload Mac PC |
JavaScript CC 2.1 sec 6.2 sec |
Moodle CC 1.8 sec 5.8 sec |
Standard theme 1.3 sec 2.9 sec |
History back Mac PC |
JavaScript CC 1 sec 3 sec |
Moodle CC 0.6 sec 2.5 sec |
Standard theme 0.3 sec 1.2 sec |
On the slower PC the page display is slightly different with the JavaScript implementation: you see the page change when the graphics are shown after the page has loaded.
In IE7 the page load is remarkably interrupted with the JavaScript version.
Answer A: Yes, the Moodle implementation brings remarkable advantages. The Moodle implementation is faster. The JavaScript implementation suffers from a worse user experience - especially in IE browsers.
Answer B: Yes, the Moodle implementation needs to be optimised. The speed difference against the standard theme is too big - especially on slower computers.