Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a max javascript filesize, what can browsers handle?

Engineering incredibly large webapps, do we have any top or limit or best practice for filesizes in these large projects? The biggest I have seen is probably twitter/gmail which had around 1mb (Minified) javascript - but how much can a browser handle?

What if there is a large app with 5mb, 10mb or 100mb javascript minified? When does it severely affect performance or memory usage (Even if the app is very well written and optimized) - can the jit handler take whatever? Are there any diminishing returns?

Is there any real example of apps beeing this big, except for the usual suspects such as gmail, twitter, facebook, googledocs, etc.

Thanks!

like image 650
neph Avatar asked Apr 12 '13 11:04

neph


1 Answers

As far as I know there is now such limit for JavaScript files, nor is there a limit at all for files of all kinds.

The only limit is the system you are running the web app on:

The browser will consume as much CPU and RAM as it needs to handle your web app. The internet connection is a bottleneck, too.

Although a web application can grow to a quite big size, there is no such real (productive used) example of an application serving JavaScript files up to 100 MB in size - I mean, think about it, 100 MB size for a JavaScript file (!), nobody would visit the page, stay on the page and wait till the download of the JavaScript files is finished and the browser's JavaScript engine processed this file.

But feel free to try write a JavaScript file which is 100 MB in size which does several tasks such as doing a console.log() a thousand times and report it here to us what happened then.


Some nostalgy: I found this bug report from Mozilla, it's nearly 13 years old.

like image 111
akluth Avatar answered Oct 14 '22 16:10

akluth