Re: [heycam/webidl] Figure-out what supporting Array-subclassing implies (#345)

> Normal DOM method call, as opposed to normal JS function call, right? It .. depends. I can only speak for SpiderMonkey at this level of specificity, and there is a bit more overhead here in SpiderMonkey than a normal DOM call, but not a lot more.

I don't particularly care about the difference? People are pretty happy to call JS functions all over the place; if [] get/set was at JS method speed I'd be happy.

Put another way, there's zero perf issues with the speed of Map.get/set function calls; if the Array-like's [] speed was similar, it would be just fine.

> As in, I'd need to see a use case to see whether the performance matters. Chances are it does not.

Yeah, the perf case we're fighting against is "the UA constantly has to parse author-provided strings back into C++ objects" (the current CSSOM), so there's a *lot* of ceiling to work under.

> Your description of what you consider reasonable semantics sounds very much like what typed arrays do.

Yes, looking into the MDN description, it does indeed sound like Typed Arrays have my desired semantics.  They coerce rather than throw, but that's done via a pre-write hook anyway, and so can be changed to do whatever I need.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/345#issuecomment-297842198

Received on Thursday, 27 April 2017 21:18:55 UTC