W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

Re: Why is querySelector much slower?

From: Glen Huang <curvedmark@gmail.com>
Date: Tue, 28 Apr 2015 14:59:07 +0800
Cc: public-webapps <public-webapps@w3.org>
Message-Id: <EA8C49BC-EDF1-42A6-B17F-9A46287E20D5@gmail.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
> querySelector with an id selector does in fact benefit from the id hashtable

Looking at the microbenchmark again, for Gecko, getElementById is around 300x faster than querySelector('#id'), and even getElementsByClassName is faster than it. It doesn't look like it benefits much from an eagerly populated hash table?

P.S it's very interesting to see Gecko is around 100x faster than others when it comes to the performance of getElementById. It probably does something unusual?
Received on Tuesday, 28 April 2015 06:59:40 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC