I noticed that IPC-over-mojo slows down significantly when the message is big:
[ RUN ] MojoChannelPerfTest.ChannelProxyPingPong
IPC_ChannelProxy_Perf_50000x_12 3776.38 ms
IPC_ChannelProxy_Perf_50000x_144 3724.65 ms
IPC_ChannelProxy_Perf_50000x_1728 4339.71 ms
IPC_ChannelProxy_Perf_12000x_20736 5292.21 ms
IPC_ChannelProxy_Perf_1000x_248832 4644.55 ms
[ RUN ] MojoInterfacePerfTest.MultiprocessPingPong
IPC_Multiprocess_Perf_50000x_12 4905.66 ms
IPC_Multiprocess_Perf_50000x_144 3856.82 ms
IPC_Multiprocess_Perf_50000x_1728 4099.34 ms
IPC_Multiprocess_Perf_12000x_20736 2575.8 ms
IPC_Multiprocess_Perf_1000x_248832 1628.98 ms
Looking at the code, most of the time is spent in the two extra copies: IPC::Message <--> std::vector<uint8_t> (as argument of mojo method call Channel.Receive()).
It should be possible to make a typemap and eliminate these two copies.
Comment 1 by bugdroid1@chromium.org
, Aug 25 2017