

Parallel script loading for improved page load - XLcommerce
http://headjs.com/#theory
Includes samples that demonstrate impressive (~50%) speedup for a page with a lot of script files.
======
ck2
Or as simple as

    
    
       <script defer async src="blah"></script>
    

for purists

    
    
       <script defer="defer" async="async" src="blah"></script>

~~~
DanielRibeiro
More about which browsers support this, its origins, and the specs:
[http://stackoverflow.com/questions/1834077/which-browsers-
su...](http://stackoverflow.com/questions/1834077/which-browsers-support-
script-async-async)

~~~
ck2
Almost all modern browsers (including IE which invented it) support DEFER.

The two most popular browsers support ASYNC going back to versions from
September 2010, Chrome 11+ and Firefox 3.6+

------
timmyd
What's better ?

HeadJS [per the link above] - [only a little dev in recent days]

LabJS - <http://labjs.com/> [seems litte more active dev]

RequireJS - <http://requirejs.org/> [most active dev]

HeadJS dev seems a little on the light side [ala none - see GitHub for each] ?
Anyone have any experience with Lab or Require ?

~~~
delambo
I can't comment on the dev activity for any of these tools, but I do have
experience with lab.js and require.js.

From what I have seen, the functionality of head.js looks like a subset of
lab.js. Lab.js has a richer API with queueing and waiting. Require.js is a
whole different beast - it revolves around the definition of modules (module
pattern) and the scripts required to pull down to organize modules. There are
a lot of tools in require.js that help with ordering the execution of loaded
scripts, pulling down files as text (can't do this in lab.js), and optimizing
(compiling modules into one big uglified file).

They are all good tools, but different - pick the best one suited for your
project.

------
hkolk
Basically, this is the same trick as google analytics now uses:
[http://code.google.com/apis/analytics/docs/tracking/asyncTra...](http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html)

We verified this at our company (we don't like it our site goes down together
with google :) ), and it works pretty good. I would advocate headjs to load
itself with it though and inline that piece of jscript

------
dave1010uk
If you're doing lots of web performance tests with loading scripts, Steve
Souder's "Cuzillion" is a really helpful tool that lets you create dummy HTML
pages that load resources with definable delays.

<http://stevesouders.com/cuzillion/>

------
bokchoi
Here is a large JavaScript loader comparison matrix.

[https://spreadsheets.google.com/ccc?key=0Aqln2akPWiMIdERkY3J...](https://spreadsheets.google.com/ccc?key=0Aqln2akPWiMIdERkY3J2OXdOUVJDTkNSQ2ZsV3hoWVE#gid=2)

Edit: All of the loaders can apparently load in parallel.

