3 ms·
This is a silly list. What? You really think document.getElementById is going to be faster than querySelector("#foo")? You really think there is a meaningful di
by bawolff 6y ago
This is a silly list. What? You really think document.getElementById is going to be faster than querySelector("#foo")? You really think there is a meaningful difference between other methods of adding event handlers, other than it being way hackier to add more than one with the other methods?
I have no idea what your objection to "this" is. Object Oriented code can be bad sometimes but so can procedural code.
- chubot 6y agoThis person has a weird unjustified objection to querySelector. I remembered this same conversation from 8 months ago where I pointed out that parsing something like '#foo' is NOT slow, he argued against it, 5 people pointed out the same thing, and he was not receptive to that feedback, etc. https://news.ycombinator.com/item?id=24054745 https://news.ycombinator.com/item?id=24054745 Performance is hard; optimizing the wrong thing is also a problem ...
- austincheney 6y agoI guess you ignored this from that thread: https://news.ycombinator.com/item?id=24057163 https://news.ycombinator.com/item?id=24057163 If jsPerf is down try http://jsbench.github.io/ http://jsbench.github.io/
- bawolff 6y agoWhat precisely do you think a microbenchmark taken out of context is going to prove?
- austincheney 6y agoThat a 250,000x performance difference is a very large gap. It’s the difference between walking 1 foot or 48 miles.
- bawolff 6y agoOr the difference between walking 1 femtometer or a quarter of a nanometer in a day where you're planning to hike 10km. And that's assuming the relative difference holds to the same degree in a real app, which seems unlikely. P.s. i also didn't get that level of difference when i tried to run the microbenchmark but i didn't try very hard.