Re: [heycam/webidl] Allow dictionary default values to reference type members (#717)

> As @kainino0x indicated I think the underlying issue here is that there might be a performance benefit to having API-styles that are more C-like and less JavaScript-like. And as you get closer to the metal it might make sense to endorse such styles, as already happened with WebGL. And it seems likely that with Wasm there might be an increase in demand for such APIs too.

For this particular API entry point, I slightly disagree. It won't be called in the rendering loop. Yeah, it will be slightly slower to map a dictionary through the bindings code compared to an int, and require allocation, but it wouldn't be terrible. There are plenty of other places in the current Web API where we do this (e.g. WebAnimations uses a dictionary that might contain a lot of style properties).

But his point is valid that there are entry points where we are trying to be as efficient as possible.  And make the mapping to WASM as simple as possible (although we're JS-first).

-- 
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/717#issuecomment-487213463

Received on Friday, 26 April 2019 21:55:41 UTC