Recently, the Page Speed team has been focusing on understanding mobile web performance best practices. Unfortunately, while we have great tools like Firebug, Page Speed, YSlow!, and Chrome/Safari Developer Tools on the desktop, no such tools exist for mobile browsers.

To start, we built a tool that allows us to analyze mobile browser network characteristics, which we’re releasing today. Using open file formats PCAP and HAR, and open source tools pcap2har, HAR Viewer, and Page Speed, we put together the PCAP Web Performance Analyzer at http://pcapperf.appspot.com/. You can capture PCAP files for your mobile devices, and then, using pcapperf, easily visualize the network waterfall for the PCAP file, get Page Speed suggestions based on the traffic in the PCAP file, or download a HAR file representation of the PCAP file.

Using pcapperf, we’ve already learned some interesting things about the performance of mobile browsers. For instance, below we confirm that the Android browser is limited to four concurrent TCP connections, as opposed to the higher limits on most other modern browsers (see HAR Viewer for Firefox, Android).

Firefox screenshot
http://goo.gl/5dP6L in Firefox 3.6, loading 10 resources in parallel

Android screenshot
http://goo.gl/5dP6L in Android 2.2, loading only four resources at a time

Thus, it is not beneficial to Parallelize downloads across hostnames on current Android devices. We can instead Combine external CSS and JavaScript, and Combine images using CSS sprites.

We also confirm that the iPhone won’t cache large resources persistently across browser sessions. Thus, on iPhone, it may be better to break up large resources into smaller chunks, or store them in the HTML5 application cache, which is not subject to the same limitations.

Other approaches

An alternative approach is to capture mobile traffic using an HTTP proxy. However, since browsers use different connection limits when connected to a proxy, network traces captured using an HTTP proxy do not reflect the behavior of browsers when running in non-proxy mode. It was critical for us to collect HTTP traffic without changing the behavior of the browser, which is why we decided to use PCAP.

Limitations and future work

Trying to profile the browser in this way does have some limitations. Namely, it’s not possible to gather information on browser events like time-to-onload, amount of time spent parsing or executing JavaScript, or amount of time requests spend waiting in the browser’s request queue due to connection limits. The rich data provided by tools like Speed Tracer is impossible to collect using network traces. It’s also difficult to profile HTTPS traffic in this way, since it requires decrypting the secure streams first.

Going forward, we hope that mobile browser developers will provide APIs and tools that allow mobile web developers to easily collect this data directly from the mobile browser, much like desktop browser tools today.

Just the beginning

This is just the beginning of our mobile web performance work. We’ve learned a lot from existing mobile web performance best practices, and we hope to contribute with new mobile best practices. The first step is collecting and analyzing data, which we’ve begun with pcapperf. We invite you to use pcapperf or any other tools to help the web performance community understand how mobile browsers differ from desktop browsers, and in turn identify new web performance best practices specific to mobile. If you discover an interesting new mobile best practice, please share it with us in the Page Speed discussion forum.

ABOUT THE AUTHOR
Bryan McQuade photo

Bryan McQuade (@bryanmcquade) leads the Page Speed team at Google. He has contributed to various projects that make the web faster, including Shared Dictionary Compression over HTTP and optimizing web servers to better utilize HTTP.

Libo Song photo

Libo Song is a Software Engineer at Google. He is a member of the Page Speed team. Recently, he helped launch mod_pagespeed.

13 Responses to “Mobile performance analysis using pcapperf”

  1. Tweets that mention Performance Calendar » Mobile performance analysis using pcapperf -- Topsy.com

    [...] This post was mentioned on Twitter by Stoyan Stefanov, Maximiliano Firtman and Ivo Teel. Ivo Teel said: Mobile performance analysis – http://bit.ly/gl2vQQ – performance calendar. [...]

  2. Peter Cranstone

    Nice job guys. We’ll be releasing an Android browser in Q1 of next year that measures mobile HTTP traffic. It generates full waterfalls and you can also include real time geo-location data. If you want to see a sample Mobile HAR report click on this link: http://www.5o9mm.com/har/viewer/accounts/5o9/mobile_har_reports.pl

    Cheers,

    Peter.

  3. Dinesh Garg

    I am unable to understand how is it different from existing pcap capturing utils for android based devices. Is it an app that is running on mobile device and when user browses the net, it gives the graphical data to user on mobile device itself?

  4. High Performance Web Sites :: bookmarklets for mobile: Mobile Perf and Page Resources

    [...] and seeing if I can find some core issues. Plus I’ll be enhancing these tools and trying pcapperf with my new 13″ MackBook Air to generate HTTP waterfall charts and Page Speed [...]

  5. Google发布移动Web性能工具PCAP Web Performance Analyzer | 傲狐人生,走向世界

    [...] 最近,Google的Page Speed团队一直在关注如何更好的优化移动Web应用性能。虽然我们拥有类似Firebug、Page Speed、YSlow!和Chrome/Safari Developer Tools等优秀工具,但是移动浏览器缺少这样的性能分析利器。为此,Page Speed团队发布了一个分析移动浏览器网络信息的工具——PCAP Web Performance Analyzer。 [...]

  6. cliveb

    my oh my, via via Steve Souders, sweet mobile web perf tool.

  7. Mobile Performance Manifesto | David B. Calhoun – Developer Blog

    [...] Perf bookmarklet pcapperf (Packet Capture Web Performance Analyzer) Blaze Mobitest – tests the loading time of your site on actual [...]

  8. Loadtimer: a mobile test harness | High Performance Web Sites

    [...] my Fire to a wifi hotspot on my laptop running tcpdump (the technique evangelized by pcapperf) doesn’t work in accelerated mode because Silk uses SPDY over SSL. This technique works when [...]

  9. Silk, iPad, Galaxy comparison | High Performance Web Sites

    [...] to build and use better tools for measuring performance. I hope Loadtimer is useful. Loadtimer plus pcapperf and the Mobile Perf bookmarklet are the start of a mobile performance toolkit. Between the three of [...]

  10. » Loadtimer: a mobile test harness xfsh

    [...] my Fire to a wifi hotspot on my laptop running tcpdump (the technique evangelized by pcapperf) doesn’t work in accelerated mode because Silk uses SPDY over SSL. This technique works when [...]

  11. » Silk, iPad, Galaxy comparison xfsh

    [...] to build and use better tools for measuring performance. I hope Loadtimer is useful. Loadtimer plus pcapperf and the Mobile Perf bookmarklet are the start of a mobile performance toolkit. Between the three of [...]

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
And here's a tool to convert HTML entities