Re: [whatwg/dom] Add validity criteria for StaticRange (#1009)

> It would be good to clarify that [w3c/csswg-drafts#4597 (comment)](https://github.com/w3c/csswg-drafts/issues/4597#issuecomment-908223745) is intentional before we move ahead with this, but overall this seems reasonable to me.

Commented [here](https://github.com/w3c/csswg-drafts/issues/4597#issuecomment-908512815).

> Have any measurements been done to show that this is indeed faster?
> 
> cc @smaug----

Yes, @ffiori built some benchmarks for this and ran them on Chromium's Highlight API prototype, with the findings  [documented here](https://docs.google.com/document/d/1byMUPIcx2cldNlppyvRP3HX9w1NIryO_F7mgQNytMzs/edit#heading=h.7nki9mck5t64). As expected, adding a large number of live Ranges to a document increases the cost of DOM node moves due to the cost of keeping the Ranges up-to-date for every DOM operation. For StaticRange, these costs were avoided, and since it's possible to cache the results of the validity checks StaticRanges were in some cases significantly fater, and never significantly slower.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1009#issuecomment-908533338

Received on Monday, 30 August 2021 17:25:52 UTC