How long JavaScript file can be in practice? [closed] - javascript

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I know this must be a silly question, but when those who create web browsers implement JavaScript and other parts, they should have some number in their mind, how big they expect the JavaScript file to be practically?
Of course modularity is good, but sometimes you just need something big. Especially machine-generated. And single file is seemingly faster to download and probably have a longer live in cache.
Some of my programs in other languages grow over 30K lines in single file, and I used to think that JavaScript is just about tiny files to handle onClicks. But now as big companies create huge apps, like spreadsheets or image editors, I wander how big the single file could be. What limits the size?

there is actually no file size limit besides from your own computer resources

As I know there isn't any limit to it.
The only limit is how much your CPU / RAM can handle?

Related

Is there a performance benefit to shipping Web Assembly vs minified Javascript? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Is there a performance benefit from serving Javascript compiled to Web Assembly (perhaps by AssemblyScript?), vs minified Javascript?
I'm specifically thinking about:
parse / compile time
execution time
byte size
memory usage
how CDNs interact with it (serving binary application/wasm vs text application/javascript)
parse / compile time
Well it's already compiled, that's the whole point of WASM. If you mean from ByteCode to Nativecode, this should be much faster than from Javascript to Native code.
execution time
Yes, faster, again it's kind of the whole point.
byte size
Debatable here, I think minified Javascript is pretty efficient here.
memory usage
WebAsembly is meant to compliment Javascript, so in theory it's the same,..
how CDNs interact with it (serving binary application/wasm vs text application/javascript)
A CDN it's just a place to ship assets, so I can't see this been an issue. eg. Fonts and images are binary, and they work fine. BTW, wasm comes with the same security policy's as Javascript, so it's not like shipping an EXE over the wire.

Any good programming practices/tools to reduce memory fragmentation in JS? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I was noticing very high usage of memory in Firefox, and I saw pages like Gmail and another heavy web-app I was working on, were >100mb! Looking through and seeing some high "unused-gc-things" in about:memory, I found this bug has been reported here and here and is a common problem without a good solution :(
Is there a good tool for detecting arenas of un-garbage-collectable objects short of compiling a special build of Firefox or other browser? And are there better methodologies of writing web-apps that don't use much memory? I would imagine using ArrayBuffer or asm.js may be more efficient as it has one set memory pool, but that doesn't play well with the usual DOM-based interaction and javascript function-al "class"-based programming of most web-apps.

javascript/Jquery code organisation [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm creating a php app where almost all requests are in ajax and some Jquery effects, so some of my pages are up to 2000 lines of code, all my jquery in one big $document.ready{}, is it normal? should I be ashamed of showing this code to other developers? or is there a better way of organasing Jquery code ?
Like how many others have said, if it's maintainable and easy to read then it shouldn't be much of an issue. However, in my experiences, code that is organized into separate logical modules were MUCH easier to read and maintain than one long document.
With that being said, the typical workflow these days with tools such as browserify would be to refactor and separate the code such that each file executes a specific task for development purposes and when it is time to deploy to production, one would use a build tool to group/minify and optimize for the browser.

Deploying my site, lots of small script files. Long loading time [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've built a web application.
In my application I have many javascript and css files .
They are separated based on my application's logic.
I am talking about close to 20 of these files (each file is 2 kb +-).
They seem to take quite a while to download (6 - 10 seconds altogether).
What would you do to cut down the download time? Are there any best practices in this field?
Thank you
Join all JavaScript and all CSS files into one big JS and one big CSS file, and minify them.
You can compress your file by removing spaces, use short variable names, etc. Try looking for tools that are around for that purpose. Also, you can add all scripting to one file so that only one files needs to be downloaded and you can introduce some caching mechanism to prevent downloading the script over and over again.
http://rakaz.nl/2006/12/make-your-pages-load-faster-by-combining-and-compressing-javascript-and-css-files.html
[http://driven-monkey.com/?p=97]
check these out

JavaScript distributed computing project [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I made a website that does absolutely nothing, and I've proven to myself that people like to stay there - I've already logged 11+ hours worth of cumulative time on the page.
My question is whether it would be possible (or practical) to use the website as a distributed computing site.
My first impulse was to find out if there were any JavaScript distributed computing projects already active, so that I could put a piece of code on the page and be done. Unfortunately, all I could find was a big list of websites that thought it might be a cool idea.
I'm thinking that I might want to start with something like integer factorization - in this case, RSA numbers. It would be easy for the server to check if an answer was correct (simply test for modulus equals zero), and also easy to implement.
Is my idea feasible? Is there already a project out there that I can use?
Take a look at http://www.igvita.com/2009/03/03/collaborative-map-reduce-in-the-browser/ and http://www.igvita.com/2009/03/07/collaborative-swarm-computing-notes/

Categories

Resources