<div dir="ltr">On Thu, Mar 8, 2018 at 5:04 PM, Mike Hommey <span dir="ltr"><<a href="mailto:mh@glandium.org" target="_blank">mh@glandium.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Mar 08, 2018 at 02:40:52PM -0800, Bobby Holley wrote:<br>
</span><span class="">> I've seen a lot of momentum around migrating chrome-only XPIDL interfaces<br>
> to WebIDL. I'm concerned that insufficient attention is being paid to the<br>
> impact on our binary size.<br>
><br>
> Fundamentally, the WebIDL bindings improve performance and spec correctness<br>
> at the expense of code size (and build times). This makes sense for things<br>
> that are web-exposed or performance-sensitive. But since the webidl<br>
> bindings are also more modern and easier to use, I'm concerned that people<br>
> will use them indiscriminately for all sorts of internal APIs, and our<br>
> binary will bloat by a thousand paper cuts.<br>
><br>
> A WebIDL method binding can easily cost a kilobyte or more, depending on<br>
> the number and types of the arguments. If we were to convert all of our<br>
> existing xpidl methods, we could approach 10MB in added code size.<br>
<br>
</span>Last time I looked at bindings, I was horrified to see all the various<br>
strings that all look the same except between bindings for field and<br>
class names. I wonder how much of the bindings cost in terms of binary<br>
size is due to that, or other similar inefficiencies. At least there<br>
seems to be a low hanging fruit there. (IIRC, the same was true of ipdl<br>
bindings)<br></blockquote><div><br></div><div>I was just measuring the methods themselves via |nm --print-size|. There might be additional per-method overhead in the data segment for the associated static tables, but the baseline size for the code itself (argument conversion, error handling, etc) is nontrivial.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Mike<br>
</font></span></blockquote></div><br></div></div>