Message from JavaScript discussions

December 2018

— Nooop

— 

querySelector is slower but it's not really important irl

https://jsperf.com/getelementbyid-vs-queryselector

— 28,441,551 her

— Ordinary chrome

— 2,008,497,329 på firefox

— Link seems broken

— But these were the results of this

— Getting nodes doesnt play big role in DOM perf, it's done at initialization stage.

— So why are the differences so drastic?

— If it's a small role?

— Because it's not important for DOM perf🤤

— I use querySelectorAll everywhere.. the slowest method... i just like/prefer the API syntax of this function

Message permanent page