On 3/8/18 8:04 PM, Mike Hommey wrote:
Last time I looked at bindings, I was horrified to see all the various
strings that all look the same except between bindings for field and
class names.

So for what it's worth, I tried measuring this recently. When measuring with "size" on Mac, if I just made all such strings "" I saved something like dozens of KB, if I recall correctly.

I wonder how much of the bindings cost in terms of binary
size is due to that, or other similar inefficiencies. At least there
seems to be a low hanging fruit there.

I expect there is, but it wasn't super-obvious low-hanging fruit. I did some other experiments as well. If I just cut out the bodies of all the "specialized methods" (getters, setters, operations), that saved about 4.5MB of codesize. That's basically the actual generated code of all of those, but not including the data tables we use to set up the prototypes, the various union/dictionary stuff, etc. That 4.5MB was about evenly split between getters, setters, and operations.

I had also spent some time trying to un-inline some things. Typically the codesize went _up_ when I did that for bindings stuff... At least on x86-64, the size overhead of a function call was bigger than the work those functions did.

It's possible that I made mistakes when making those measurements, of course.

The other relevant data point is that iirc I measured about 8800 getters/setters/operations. So they're averaging about 500 bytes each. I don't know how big the xptinfo is for a single xpidl method. I also don't know how well these various bits share across processes. And there's some memory usage (in those data tables I mentioned) even outside the code of the webidl methods.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to