Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioned dom #8227

Merged
merged 3 commits into from Nov 9, 2015
Merged

Versioned dom #8227

merged 3 commits into from Nov 9, 2015

Commits on Nov 6, 2015

  1. Added versioning to DOM nodes.

    There is now an inclusive_descendants_version field of each node, which
    increases each time the node, or any of its descendants, is dirtied.
    This can be used for cache invalidation, by caching a version number
    and comparting the current version number against the cached version number.
    asajeffrey committed Nov 6, 2015
  2. Caching HTMCollections.

    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.
    asajeffrey committed Nov 6, 2015
You can’t perform that action at this time.