This may be a stupid question, but I still have it . Does having spaces between the code lines in anyway affect the performance of the JavaScript code.
How effective is the minified version of the JavaScript file?
Any ways to optimize the code performance?
Minifying code will decrease the time needed to download the file and initially parse and compile it. The runtime performance isn’t going to be affected.
The effect is likely to be immeasurably small unless you have absolutely huge source files (tens of thousands of lines), in which case minifying it does make sense. How much effect minification has depends on how large the files are, but I’ve seen some libraries drop dramatically in size when minified (such as ExtJS).
Improving the runtime performance is something that can’t really be covered in a single answer unless you’ve got specific code you want optimized. If you’re looking to optimize the runtime performance of your code, start by profiling it and identifying where it is spending most of its time. If you’re using Chrome, it has a built in profiler in its developer tools. Firefox may have one these days too, but I’m not sure.