O'Reilly logo

Web Performance Daybook Volume 2 by Stoyan Stefanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 20. Beyond Web Developer Tools: Strace

Tony Gentilcore

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required