After learning that concatenating and possibly gzipping a javascript file could enhance the speed of an application, I decided to test it out.
It seemed like most of my pages (although not all) were downloading around 1mb of javascript, so why not compress and aggregate it?
To my surprise, the performance seems to have worsened. Firebug is indicating that the "DomContentLoaded" took 1.17s on any random page of the application. Is this normal? Quite alarming.
Essentially, my application's javascript now combines all files for the site. Each file searches for a main id, and if found, executes some code. Otherwise, it proceeds to the next function block.
I have incorporated several libraries along with my application code. Here are the libraries I'm utilizing. Should I have aggregated these as well?
<include>**/font/font.js</include>
<include>**/json/json2.js</include>
<include>**/jwplayer/jwplayer.js</include>
<include>**/underscore/underscore.js</include>
<include>**/jquery/jquery-1.7.1.js</include>
<include>**/jquery/jquery-ui-1.8.16.custom.min.js</include>
<include>**/jquery/jquery.cookie.js</include>
<include>**/jquery/jquery.jcrop.js</include>
<include>**/jquery/jquery.tmpl.js</include>
<include>**/jquery/farbtastic.js</include>
<include>**/simpleyui/simpleyui.js</include>
<include>**/audio-player/audio-player.js</include>
<include>**/tiny_mce/tiny_mce.js</include>
<include>**/jscharts/jscharts.js</include>
The major sizes contributing to my footprint are in jquery-1.7.1.js
(100k), jquery-ui-1.8.16.custom.min.js
(206k), jwplayer.js
(83k), simpleyui.js
(103k), jscharts.js
(100k), and tiny_mce.js
(186k). Surprisingly, these amounts are minified.
I've tried experimenting with gzipping the content upon request, but unfortunately, it slowed things down. It seems like rackspace cloud's CPUs might not be very fast, adding significant time to the request. Disabling gzipping on demand appears to improve performance.
EDIT: After testing, placing the javascript at the bottom of the page doesn't show any difference. Removing all libraries such as jquery, audio-player, jwplayer, etc., solely takes about 1 second.
My application code, which comprises more files but less overall code, typically takes around .2 to .3 seconds.
I strongly believe the issue lies more in execution speed rather than download speed now.
What recommendations would you suggest to enhance the performance of my pages?