-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We cache the state of any live HTMLCollection, keeping track of a) the optional cached length of the collection, and b) an optional cursor into the collection (a node in the collection plus its index). The cache is invalidated based on the version number of the node. We use these caches for speeding up random access to the collection. When returning coll[i], we search from the cursor, if it exists, and otherwise search from the front of the collection. In particular, both a forward for-loop and a backward for-loop through the collection will now have each access take O(1) time rather than O(n) time. This gets 1000x speed-up on the relevant Dromaeo DOM query tests.
- Loading branch information
Alan Jeffrey
committed
Nov 6, 2015
1 parent
64a50bc
commit 237ddc3
Showing
3 changed files
with
291 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.