Re:CoffeeScript: The beautiful way to write JavaScript
by jashkenas on Tuesday March 08, 2011 @07:27PM
(#2303234)
Absolutely, and CoffeeScript worries about your JS performance for you, when it can. In my personal experience, translating JS to Coffee tends to speed up the performance of the resulting script, due to the optimizations the CoffeeScript compiler adds.
To be specific, the main speedup I tend to get is this: If I'm working with JS, I'll tend to use a "forEach" function frequently, for looping over lists:
Re:CoffeeScript: The beautiful way to write JavaScript
by cpeterso on Wednesday March 09, 2011 @07:35PM
(#2307369)
Does CoffeeScript include an optimizer/minifier? Google's "Closure" Compiler for JavaScript is able to inline functions and perform other interesting optimizations.
To be specific, the main speedup I tend to get is this: If I'm working with JS, I'll tend to use a "forEach" function frequently, for looping over lists:
In CoffeeScript, you'd write it like this: ... and instead of the slow "forEach" function, you get a much faster native "for" loop.