Oss sahana: Difference between revisions
Line 9: | Line 9: | ||
== Script Loader Instances == | == Script Loader Instances == | ||
The current instances of script loaders are found in “to be implemented” code blocks, visible within eden/views/pr/index.html and eden/views/dvi/index.html | |||
Conditions | |||
Checks if the user is client is operating in s3.debug and if so link: | |||
jqplot.css | |||
query.jqplot.js | |||
jqplot_plugins/jqplot.pieRenderer.js | |||
and | |||
excanvas.js if the browser is IE | |||
Otherwise | |||
jqplot.min.css | |||
query.min.jqplot.js | |||
jqplot_plugins/jqplot.pieRenderer.min.js | |||
and | |||
excanvas.min.js if the browser is IE | |||
Essentially this conditional formatting allows the production code to utilize scripts and style sheets on their minimized versions. Not only does this remove bloat from page loads, inherently the speed of page loads is quicker with smaller files to reference. Using a script loader with this conditional ability as well as asynchronous loading will greatly reduce the time in a page load. | |||
The section indicated to include a script loader has the following implementation: | |||
<script language="javascript" type="text/javascript" | |||
src="/{{=appname}}/static/scripts/jquery.jqplot.js"> | |||
</script> | |||
<script language="javascript" type="text/javascript" | |||
src="/{{=appname}}/static/scripts/jqplot_plugins/jqplot.pieRenderer.js"> | |||
</script> | |||
Without a script loader, the average loading time is 159.18 milliseconds. | |||
== Script Loading Comparison == | == Script Loading Comparison == |
Revision as of 02:25, 29 October 2014
INVESTIGATE USING LABJS TO SPEED UP JAVASCRIPT LOADS
Introduction
We are investigating the performance of different script loaders to help the Sahana Eden group achieve some enhancements on their website, for instance to make it either faster or use less bandwidth. Under the current course project for csc517, we will investigate the possibility of loading large page dependencies with different script loaders and see if there is any improvement in the loading time. Yepnope is currently used in the sahana eden project, and there are some alternatives that are available and will be tested under this project.
Script Loader Instances
The current instances of script loaders are found in “to be implemented” code blocks, visible within eden/views/pr/index.html and eden/views/dvi/index.html
Conditions Checks if the user is client is operating in s3.debug and if so link: jqplot.css query.jqplot.js jqplot_plugins/jqplot.pieRenderer.js
and
excanvas.js if the browser is IE Otherwise jqplot.min.css query.min.jqplot.js jqplot_plugins/jqplot.pieRenderer.min.js
and
excanvas.min.js if the browser is IE
Essentially this conditional formatting allows the production code to utilize scripts and style sheets on their minimized versions. Not only does this remove bloat from page loads, inherently the speed of page loads is quicker with smaller files to reference. Using a script loader with this conditional ability as well as asynchronous loading will greatly reduce the time in a page load.
The section indicated to include a script loader has the following implementation:
<script language="javascript" type="text/javascript"
src="/Template:=appname/static/scripts/jquery.jqplot.js">
</script> <script language="javascript" type="text/javascript"
src="/Template:=appname/static/scripts/jqplot_plugins/jqplot.pieRenderer.js">
</script>
Without a script loader, the average loading time is 159.18 milliseconds.