mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 04:05:32 +00:00
37cbcb454b
Each protocol in IPDL has a bunch of autogenerated functions that instantiate IPC::Message with various parameters. Each of these functions, then: 1) Pays the cost of calling malloc() 2) Setting up various parameters 3) Calling IPC::Message() There's no reason that we should be duplicating 1) across all of these autogenerated functions. In step 2), several of the parameters we're setting up are common across all or nearly all calls: the message segment size is almost always zero, and we're always indicating that IPDL-generated messages should be recorded in telemetry. Instead of duplicating that code several thousand times, we can add a small helper function that takes the only interesting parameters for an IPDL message. This helper function can then deal with calling malloc in a single place and setting up the common parameters. For messages that require a custom segment size, we'll have to use the old scheme, but such messages are uncommon. The previous changes are not required for this scheme to work, but they do help significantly, as the helper function (Message::IPDLMessage) can now take four parameters, which ensures that its arguments are passed solely in registers on Win64 and ARM. The wins from this change are also larger than they would be without the previous parts: ~100K on x86-64 Linux (!) and ~80K on ARM Android. |
||
---|---|---|
.. | ||
ipdl | ||
test | ||
ipdl.py | ||
Makefile.in | ||
message-metadata.ini | ||
moz.build | ||
msgtype-components | ||
sync-messages.ini |