Re: [whatwg/dom] Suggestion: `Node.insertAfter(newNode, referenceNode)` (#986)

> Are there benchmarks for this? @smaug---- @rniwa thoughts?

@annevk As for the cost of C++, [consider this diff](https://github.com/MithrilJS/mithril.js/commit/a1a7038e55b0f058f5f86d06479d6a7c1f46c8e1). We got serious gains from two things:

1. Avoiding a polymorphic property lookup by performing a polymorphic type check on the value first (counterintuitive, but it made a noticeable difference).
2. Avoiding a long series of unnecessary calls to C++ land and reducing it to a dictionary property update.

And that's for a [reasonably](https://dom.spec.whatwg.org/#add-an-event-listener) [simple](https://dom.spec.whatwg.org/#remove-an-event-listener) pair of algorithms. (The date of that diff should give you an idea how long ago I last ran those benchmarks, but I've watched the situation on JS perf, and little has changed in this area - I can tell you that for certain.)

-- 
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/issues/986#issuecomment-860465952

Received on Monday, 14 June 2021 07:49:59 UTC