Chrome uses the default buffer size for its IPC pipes of 4 KB. Once message overhead is subtracted this means that additional context switches are needed for messages larger than about 3,900 bytes. The actual impact of this is unknown because the distribution of message sizes is unknown, but context switches are definitely expensive because of the kernel transitions and the cache pollution. There are a few investigative things worth doing in regards to this:
- Instrumenting mojo in order to find out typical message sizes to find out how big a problem this is
- Perhaps make mojo auto-adjust the buffer sizes so that the pipes which are used to carry larger messages are auto-expanded. The buffer sizes don't have to be big enough to accommodate the largest messages, but they should be big enough to reduce the number of excess context switches.
This was observed some years ago when doing performance testing with ipc_perftests, using ETW tracing or internal monitoring (see Chrome's task manager) to count context switches.
Comment 1 by erikc...@chromium.org
, Nov 8