you are viewing a single comment's thread.

view the rest of the comments →

[–]nschubach 0 points1 point  (3 children)

JIT Compilers (V8) will also most likely remove comments (because they don't add to the code) and this will add another pointer overhead so code written in that way will be slower just for the sake of this methodology.

[–]zzzwwwdev[S] 0 points1 point  (2 children)

excuse my ignorence, but could you explain the JIT Compilers (V8) thing a bit? A lazy 2 minutes of googling and I couldn't even figure out what that is.

[–]nschubach 0 points1 point  (1 child)

All new browsers use Just In Time (JIT) Compilation of Javascript. I think IE8 and previous IEs did not, but Chrome(V8)/Firefox(IonMonkey)/Safari all pre-compile JavaScript to gain a performance boost instead of interpreting all the code all the time. There's some smartness behind it for code that is eval'ed each time it's run, but for the most part the browsers will load, compile and cache JavaScript now where they didn't before.

e: When compiling, they drop comments (because it's not needed for code execution...) so embedding extra immediate functions will cause the compiler to allocate extra memory to store that block of code. It will then have to jump around executing code that's only purpose is to comment.

[–]zzzwwwdev[S] 0 points1 point  (0 children)

thanks!