Chapter 20. Beyond Web Developer Tools: Strace
Rich developer tools are available for all modern web browsers. They are typically easy to use and can provide all the information necessary to optimize web pages. It is rare to need to go beyond the unified networking/scripting/rendering view of the Web Inspector’s Timeline panel (http://www.webkit.org/blog/1091/more-web-inspector-updates/#timeline_panel).
But they aren’t always perfect: a tool may be missing information, may disagree with another tool, or may just be incorrect. For instance, a recent bug (https://bugs.webkit.org/show_bug.cgi?id=58354) occasionally caused two Navigation Timing (https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html) metrics to be incorrect in Chrome (and the Inspector).
When these rare situations arise, great engineers are able to go
beyond a browser’s developer tools to find out exactly what the browser is
telling the operating system to do. On Linux, this source of ultimate truth
can be found using strace. This tool can trace each
system call made by a browser. Since every network and file access entails a
system call, and this is where browsers spend a lot of their time, it is
perfect for debugging many types of browser performance issues.
What About Other Platforms?
In this post, I introduce strace because the syntax is clean and no setup is required. But most systems have an equivalent tool for tracing system calls. Mobile developers will be happy to hear that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access