browserify / browserify-handbook

how to build modular applications with browserify
Other
4.58k stars 292 forks source link

soften language for d/l time saved, + GZip note #6

Open tomByrer opened 10 years ago

tomByrer commented 10 years ago

https://github.com/substack/browserify-handbook#window-globals

This approach tends to be very slow since each script tag initiates a new round-trip http request... loads much faster because only a single http request for a single script tag needs to execute

Honestly, I think improved speed depends on the resources needed for the app & loading order. A few external resources hosted on a CDN or separate server (with unique originating URL) could load concurrently, thanks to most browsers having spare Max Connections. A browserified/concocted chunk may have to wait for open HTTP connection, since "Connections per Hostname" has a smaller cap. True, an extra HTTP lookup is needed, but lookup time can be reduced, & IP &/or file may be cached already.| I did note the extra GZip reduction. But even at best 10 browserified files may save 10 HTTP packets, likely 5, so a few Kilobytes? Since there are so many variables, I softened the language of the impact.

I'm willing to see some hard proofs either way.

ghost commented 10 years ago

It's more about latency because on lousy conections like 3g each round-trip can be really costly.

wilmoore commented 10 years ago

Also, loading tons of script tags on a resource limited set-top-box can be a nightmare.