Improving DevTools startup time
Interested in helping improve DevTools? Sign up to participate in Google User Research here.
DevTools startup now is ~13% faster 🎉 (from 11.2s down to 10s)
TL;DR; The result is achieved by removing a redundant serialization.
The mechanism Chromium uses to send DevTools commands to V8 (and for IPC in general) is called
mojo. My teammates Benedikt Meurer and Sigurd Schneider discovered an inefficiency while working on another task, and came up with an idea to improve the process by removing two redundant steps in how these messages are sent and received.
Let us dive into how the
mojo mechanism works!
There is a mojo command
EvaluateScript which runs the JS command. It serializes the whole JS command including the
Benedikt Meurer realised that serialisation and deserialisation of the
arguments is quite expensive, and that the whole "Serialize JS command to JS string" and "Deserialize JS string" steps are redundant and can be skipped.
How we improved
For technical details on how we implemented this optimization, consult these two patches:
- CL 2431864: [devtools] Reduce performance overhead of message dispatch in the front-end
- CL 2442012: [devtools] Use
For both revisions, we ran the following scenario 5 times:
- Record trace using
- Open DevTools-on-DevTools
- Get the recorded
CrRendererMaintrace and compare the V8-specific metrics.
Based on these experiments, DevTools opens ~13% faster (from 11.2s down to 10s) with the optimization.
Highlights, CPU durations
|Method name||Not optimized (ms)||Optimized (ms)||Differences (ms)||Speed improvement (%)|
As a result, DevTools opens and works faster with less CPU usage. 🎉
Download the preview channels
Consider using the Chrome Canary, Dev or Beta as your default development browser. These preview channels give you access to the latest DevTools features, test cutting-edge web platform APIs, and find issues on your site before your users do!
Getting in touch with the Chrome DevTools team
Use the following options to discuss the new features and changes in the post, or anything else related to DevTools.
- Submit a suggestion or feedback to us via crbug.com.
- Report a DevTools issue using the More options > Help > Report a DevTools issues in DevTools.
- Tweet at @ChromeDevTools.
- Leave comments on our What's new in DevTools YouTube videos or DevTools Tips YouTube videos.
More from the Chrome DevTools team
Subscribe to Chrome DevTools blog to stay up to date with the DevTools news.