- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Thu, 25 Jul 2013 09:02:50 -0700
- To: whatwg@lists.whatwg.org
On 7/24/13 5:39 PM, Ryosuke Niwa wrote: > Indeed. Note that querySelector implementations in WebKit and Blink optimize #foo, .foo, etc... so that they're equally if not faster than getElementsById, getElementsByClassName, etc... I have a hard time reconciling that claim with either code-inspection of WebKit code, general considerations of what it takes to implement these methods, or the numbers I see in Chrome on http://jsperf.com/queryselector-vs-dom Now I realize that for querySelectorAll vs getElementsByClassName that microbenchmark largely shows the "reuse same list vs have to create a new list" difference, but real-life code would show such a difference too, in many cases. -Boris
Received on Thursday, 25 July 2013 16:03:20 UTC