Friday, February 03, 2012

An Experiment with Google Services & Page Speed

When building eCommerce sites, we deal a lot with performance.  Not just ensuring that our sites respond quickly, but also working with customers to explain what makes up the overall performance characteristics of a site, and what might be impacting theirs.  Unfortunately, performance tends to be misunderstood among both technical and non-technical persons.  Frequently we receive reports about “slow sites” with customers assuming the problem lies within our services and obviously looking for a solution.  In most cases, the slow-downs on the sites actually tend to come from external factors like 3rd party scripts, yet it seems like every service out there wants you to drop one of their tracking scripts on your page.

There are now a number of tools on the market which aim to give a single score metric indicating the performance of your site, the most commonly used one seems to be Google Page Speed. 

I decided to run a little experiment to see how adding Google services to a page affected both performance and Page Speed scores.

First, my setup:

  • Firefox 10.0 with Firebug 1.8.4
  • Files hosted at same datacenter facility as our eCommerce sites (not locally)
  • 100mbit internet connection at testing location
  • CPU is a Xeon X5550, 18GB RAM, 2x SAS 15K drives in RAID-0 (workstation performance definitely isn’t going to be the bottleneck here!)

To start, I created a plain-old XHTML 1.0 Transitional page with 10 paragraphs of Lorem Ipsum text. I then added Google Services to the page one at a time, starting with Google Analytics (the most commonly included script I could think of).  For each page, I reloaded it with CTRL-F5 in order to ensure I did not use any cached resources.  GZIP was disabled on the server hosting the HTML pages to ensure the compression times did not affect time-to-first-byte (TTFB).

The pages I tested with can be found at the following links:

The results are interesting to say the least:

Test Description On-Load Time (ms) Size (KB) # Requests Page Speed Score
1 Plain-old HTML 82 7.2 1 92
2 Added Google Analytics 287 20.8 3 93
3 Added AdWords Conversion Tracking 366 23.7 6 92
4 Added Google Plus button 830 126.2 12 94
5 Added embedded Google Maps 6130 414.9 35 94

The most interesting part was that the more services I added and the slower the site performed, the better the Page Speed score got!  In fact, the end result was a page with a load time 75x slower than the original, 57x larger and with 35x the number of requests yet the Page Speed Score increased by 2 over the original.

It just goes to show that you cannot base your analysis of a site solely on a single tool.  Your site might have a Page Speed score of 94, but an on-load time of 6.1sec is obviously going to be perceived as very slow to users.   And don’t even get me started about Google Webmaster Tools!