In Browsers minifying and concating or loading asynchronous JavaScript has a positive performance impact. Is this also true for code running in Node.js?
As Example would excessive commenting and using long names for properties of classes that are instantiated often impact performance and memory usage significantly?
Minifying strips out all comments, superfluous white space and shortens variable names. It thus reduces download time for your JavaScript files as they are (usually) a lot smaller in filesize. So, yes it does improve performance.
Since node. js runs on the server, I'd say it's meaningless to minify the code.
Uglification improves performance while reducing readability. Encryption: This is the process of translating data, called plain data, into encoded data. This encrypted, or encoded, data is known as ciphertext, and needs a secret key in order to decrypt it.
The virtual machine can take the source code to compile it into the machine code at runtime. What it means is that all the “hot” functions that get called often than not can be compiled to the machine code thus boosting the execution speed.
Yes, it improves compile-time performance, but compile-time is so insignificant to the overall lifetime of your process that it shouldn't matter. The only difference would be if you're constantly starting and stopping node programs for some weird reason, which if you're doing, is probably wrong.
You won't want to uglify your server-side code, however, because if you get an error back, you'll want to know where in your human-readable code it is to find it and fix it.
I bet the real question is: Do you think the almost insignificant compile-time performance will offset the time it saves to debug your code instead?
The answer to that would be no, just stick with normal human-readable Javascript instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With