DescriptionAdd fast path for #id / tag#id selector queries
Add fast path for #id / tag#id selector queries, even in the cases where the
case where the document contains multiple elements with the same id.
DocumentOrderedMap was updated so that the hash table values contain the
ordered vector of all matching Elements (lazily populated).
DocumentOrderedMap now supports getAllElementsById() operation in addition
to the pre-existing getElementById() one.
I see the following impact of BrowserMark test cases (Linux Desktop):
05_DOM_Create_Source: +190.5% (~2.9x better)
06_DOM_Dynamic_Create: +150.0% (~2.5x better)
Those tests were spending most of their time traversing the tree due to the
"div#hidden_playground" query. That query would go through the slow path
because:
- We did not support going through fast path for tag#id queries, only #id
ones.
- The id is not unique in the document.
This is a partial merge of WebKit r150187 by <rniwa@webkit.org>.
R=esprehn
BUG=323962
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164102
Patch Set 1 #
Total comments: 12
Patch Set 2 : Fix clusterfuzz crash and remove FIXME comment #Patch Set 3 : Fix clusterfuzz crash and remove FIXME comment #
Total comments: 6
Patch Set 4 : Take feedback into consideration #
Total comments: 2
Patch Set 5 : Move emptyVector #
Messages
Total messages: 21 (0 generated)
|