js-mythbusters icon indicating copy to clipboard operation
js-mythbusters copied to clipboard

Add DOM tips

Open Kikobeats opened this issue 8 years ago • 3 comments

  • Caching DOM selector
  • moar

Related: http://www.w3schools.com/js/js_performance.asp

I'm sure that @rstacruz know more tips in this are than me 😄 .

Kikobeats avatar Aug 31 '16 10:08 Kikobeats

don't use variables

AFAIK, this isn't always true. Sometimes it might be faster to have a variable in v8. I don't have a link to point to info on this, might have to benchmark it :)

rstacruz avatar Aug 31 '16 10:08 rstacruz

By the way, have a look at github.com/codemix/fast.js :)

rstacruz avatar Aug 31 '16 10:08 rstacruz

yes, I don't like the don't use variables tip. I think that is related more with the fact of don't use a variable that don't alive the necessary time to be cached by v8.

Kikobeats avatar Aug 31 '16 10:08 Kikobeats