bendc / frontend-guidelines

Some HTML, CSS and JS best practices.
8.29k stars 653 forks source link

JS never your performance bottleneck? #725

Closed ttback closed 9 years ago

ttback commented 9 years ago

Never worry about writing performant JS just doesn't make any sense... for example, throttle on things like scrolling event is essential to have smooth 60 fps scrolling. Since JS will never be a perf bottleneck, why would people still bother to pre-compile handlebar templates?

bendc commented 9 years ago

Messing with something like scroll events is related to the DOM, not JavaScript per se. There are some edge cases where JS should be optimized, but it's extremely unusual. In most cases, perf issues won't be related to JS.

reneroth commented 9 years ago

Although this has already been closed it's important to add that if you're using scroll events, you're nearly always doing something horribly wrong and should be using requestAnimationFrame instead.