Tools

Joshua Marantz (Google): Why erring on the conservative side is a good thing [PODCAST]

One of the greatest perks of my job is that I get to talk to geniuses on a daily basis. I was extremely privileged to be able to chat recently with yet another genius: Joshua Marantz, leader of mod_pagespeed at Google.

We covered a lot of ground, from philosophical to pragmatic topics. You’re going to enjoy this podcast if you’ve ever wondered:

  • What the heck is the difference between PageSpeed and mod_pagespeed?
  • Where does front-end optimization belong in order to deliver the best possible results: near the edge, near the server, or some point in between?
  • Will FEO someday be completely taken care of at the browser and server level?

We also talked quite a bit about images, which has been a recurring theme here lately. While Josh and I agree that what’s unambiguously good for the speed of a page is aggressive lossless image compression, he explains why that feature is not turned on by default in mod_pagespeed (though he says that he always tells people that it’s the first feature they should try to turn on).

Enjoy. And as always, if you have any questions, feedback, or suggestions for future guests or topics, drop me a line at joshua[[at]]webperformancetoday[[dot]]com.

Listen to the podcast: Joshua Marantz

Related posts:

Web Performance 101: An opinionated guide to the 22 links every developer should read

If you’re just starting out on your web performance journey, it’s easy to feel overwhelmed by how much there is to learn about something as “simple” as making pages faster.

When I started this blog three years ago, if you wanted to learn about optimizing performance, the pickings were on the slim side — though generally you could count on any resources you found to be pretty solid. These days, things are different. There’s a massive number of blog posts, videos, and slide decks — but the problem is that there’s a lot of redundant (or to be frank, not super great) information out there.

In this post, I’m going to separate the wheat from the chaff and offer my opinionated guide to the links you should check out if you’re a dev who’s new to the performance scene.

The Manifesto

The Vanilla Web Diet

Despite years of development and performance advocacy, the internet has a serious obesity problem that’s hurting application and page speed. This is a great piece from Smashing Magazine that discusses the reasons behind this trend and finishes with a bold declaration.

The Essentials

If I were teaching a course about performance, these would be required reading/viewing on week one.

Steve Souders’s 14 Rules for Faster-Loading Web Sites

Like Mecca, all web performance roads lead back to Steve Souders’s original performance rules. If you do your job right, one day you’ll have these committed to memory.

Faster Websites: Crash course on web performance

As I mentioned in last week’s podcast, what Google developer advocate Ilya Grigorik doesn’t know about performance isn’t worth knowing. In this three-hour video, he gives an awesome overview of the subject.

The Basics

Make sure you’re taking care of the easy stuff before you dive into the hard stuff. How to pluck the low-hanging fruit from the performance tree.

Waterfalls 101: How to read a waterfall chart

First, you can’t be in this business unless you know how to read a waterfall chart. Our VP Product, Hooman Beheshti, breaks it down really well in this recorded webinar. (If you want the written version instead, there’s a post here.)

Let’s Do Simple Stuff to Make Our Websites Faster

Four easy things you can do to make your website faster.

Slow website? Five ways to speed it up

Five more ways to speed up your pages.

Mobile

If you want to still have a job in performance in five years, I suggest you bone up on mobile.

15 things you can (and should) do to make your site faster for mobile users

Mobile devices and browsers pose some unique performance challenges. There are a number of fundamental and advanced tactics that you can use to take on these challenges and win.

Mobile HTML5

Maximiliano Firtman created this awesome table that illustrates HTML5 compatibility across major mobile and tablet browsers.

Responsive Web Design

Technically, RWD belongs with mobile, but it’s such a hot-button topic these days that I wanted to give it its own section.

Creating a Mobile-First Responsive Web Design

Really, you should just read pretty much everything Brad Frost writes about RWD. This is a good place to start.

Responsive Responsive Design

You may have heard that responsive design means poor performance. Tim Kadlec discusses why this doesn’t need to be true.

Images

Images are one of the single greatest performance problems, but they’re not sexy so they don’t get the attention they deserve. I’m working on a separate post about this, but in the meantime, check out these links.

Optimizing Web Graphics

Good introduction to image optimization from the folks at the Google Dev Blog.

Progressive jpegs: A new best practice

Photos are the main culprit when it comes to slow rendering. Eye-opening stuff about the adoption of progressive jpegs and how well progressive jpegs load across different browsers.

Third-Party Scripts

Third-party scripts are a huge potential point of failure. You need to know how to mitigate this.

Has your site’s third-party content gone rogue? Here’s how to regain control.

This post will help you understand the third-party problem and how to get a handle on it.

Social button BFFs

Good tutorial from Stoyan Stefanov explaining how to make your social buttons load asynchronously.

Complete asynchronous ad loading using DFP and LABjs

You can’t optimize the ads that appear on your site, but you can at least ensure they’re not blocking the rest of the page. Sajal Kayan explains how to use DFP’s iframe tagging, combined with LABjs and little bit of JavaScript hackery, to make any ad load asynchronously with negligible impact on rest of the pageload.

Security

Security is an increasingly urgent issue. You need to know what impact it has on performance.

Speed vs. security: Four ways that security solutions can cause performance problems (and what you can do about it)

Security solutions can be performance bottlenecks, but this doesn’t get talked about very much so I wrote this post about it.

5 easy tips to accelerate SSL

Some folks believe that we just have to suck up the fact that SSL is slow. Not true. Here are some relatively simple workarounds.

SSL Performance Case Study

SSL (Secure Sockets Layer) optimization is extremely complicated, but as William Chan argues, “There’s low-hanging fruit everywhere” for site owners willing to try. In this article, William takes us through an in-depth case study of SSL optimization.

Fonts

Web Font Performance: Weighing @font-face Options and Alternatives

Great collection of tips for making sure your web fonts aren’t slowing down your pages.

Tools

WebPerfDays: Performance Tools

At WebPerfDays London, Steve Souders asked attendees to name their favourite web performance tool. This is a great roundup of tools that smart folks are using.

Improving site performance with YSlow

YSlow is one of the most commonly used tools for helping you analyze the performance of a website based on performance best practices. It’s available as a plugin for all major browsers except Internet Explorer, and it offers usable insight into real-world performance. This tutorial is a great introduction for anyone using YSlow for the first time, or for those who want to learn to use it better.

Configuring an ‘all-in-one’ WebPageTest Private Instance

Using WebPagetest to test a private instance –- i.e. an application that isn’t publicly accessible -– is reasonably straightforward save for a few small differences. Andy Davies walks us through the process.

The Back End

Speeding Up Your Website’s Database

We tend to focus on the front end (and for good reason), but sometimes it’s the back end that’s at least partially to blame. This is a good how-to piece from Smashing Magazine that explains how a database can slow down your site, and how to speed it back up again.

Read more

This is skimming just some of the cream off the top. I’m sure I’ve missed a few links, so feel free to suggest them in the comments and I’ll update this list. If you want to really dig deep, we have a massive Web Performance Hub on the Strangeloop site where we post every great link we find, and I definitely encourage you to check it out.

Related posts:

Ilya Grigorik (Google): When it comes to tackling web performance, we all still have a lot to learn [PODCAST]

It doesn’t matter what area of web performance you specialize in, if you’re anywhere in the performance space, this week’s podcast has something for you:

  • social analytics
  • RUM
  • SPDY
  • HTTP 2.0
  • CDNs
  • mobile performance
  • scuttlebutt about sharing an office with Steve Souders

The guy who’s delivering the goods on all these facets of performance is Ilya Grigorik, one of the smartest people I’ve ever talked to, inside or outside our industry. Ilya has a fascinating breadth of experience. He’s deep in the weeds on a few sides of the performance equation: from protocols to analytics to how pages are actually put together. As developer advocate at Google, he’s not only chin deep in Google Analytics and SPDY, but also walking the DOM and fiddling with CSS. And he gets to share an office with Steve, which you’ll hear me grill him mercilessly about. :)

What makes talking with Ilya really refreshing is that he doesn’t just have a lot to share about what he knows — he’s also really candid about what we don’t know and what we could be doing better. And he’s remarkably upbeat about the Sisyphean task of making the entire web faster. Enjoy.

Listen to the podcast: Ilya Grigorik

Related posts:

Get a real-world sense of how real users see your site: Test your load times the old-school way

Taking care of a site is kind of like farming. In this day and age, you can manage your crops with spreadsheets and high-tech equipment, but if you really want to know what’s going on, you have to get out in the field, rub some dirt between your fingers, and give it a whiff.

I was reminded of this by a really good question that was asked at the WebPerfDays event that followed Velocity EU a couple of weeks back:

Is this crazy talk? Why would anyone choose to go lo-fi when we have such incredible real-user monitoring (RUM) tools available?

Actually, there are some solid reasons for performing lo-fi performance tests:

  • You want to validate your RUM data, but you’re skeptical about synthetic tests.
  • Onload is not always a good proxy for when a page feels ready. You can capture that feeling when you ask people to stop the watch when they feel pages are loaded.
  • You want to time when specific elements (e.g banners, ads, social sharing buttons) appear, and get a feeling of how this feels in the context of the entire page load.
  • If you’re not a hardcore performance geek, perhaps you don’t want to learn how to interpret reams of RUM data. You want a layperson-friendly approach that gives believable results.

Today I want to talk about a low-tech way to measure performance, either to validate your high-tech results or to give you an introduction to performance. I call it (drumroll) …

Stopwatch timing (pretty much what it sounds like)

This is as simple as it sounds: load a page and time how long it takes to render. It’s amazing how few people actually do this. All you need is a good stopwatch, a few testers on connections and browsers that mimic those of your users, and some patience. (Aside: In researching stopwatches and web timing I came across this archaic — in web terms — tool called StopWatch that still seems to work, despite being seven years old and developed pre-Chrome. Retro.)

I’ve always wanted a cool stopwatch like this one:

But I had to settle for the stopwatch on my phone:

I picked our own site (www.strangeloopnetworks.com) because I always pick on other people and I wanted to see if I could learn anything new about my own site with this approach.

Step 1: Gather assumptions

I made a few assumptions:

  • I assumed the page would be hit from a corporate network. (I’m currently in the office.)
  • I just saw this interesting infographic about when to spam people, so I assumed a test between 9-10:30 AM would be best.
  • Looking at our analytics, it looks like we have a lot of Chrome users, so I used Chrome.

Step 2: Establish a baseline with WebPagetest

I wanted to get a baseline, so I first ran a WebPagetest from our office over a FIOS network (we have fast internet here) to see what it would look like on Chrome. Here’s a closeup of the filmstrip view of the results, showing that the bulk of visible content arrives at 1.4 seconds:

Step 3: Run the clock

Then I cleared my cache and cookies, took out the stopwatch, and started to play. I didn’t get to play for long. I stopped the clock when the page seemed to fully load: at 1.2 seconds.

Step 4: Compare the results

It’s interesting to contrast the stopwatch results with WebPagetest’s document complete results.

1.882 seconds is fast, but it’s about 57% slower than the perceived load time of 1.2 seconds. This just serves to highlight that onload — a metric that most RUM and synthetic tools focus on — doesn’t necessarily give you the best idea of how a page feels for real visitors. (Note that there’s a good reason why tests use onload as a proxy for when a page is ready: namely, there is no utterly consistent proxy that applies across all sites. Onload is the best we have.)

As a side note, it was good to see that WebPagetest’s filmstrip view was very close to my stopwatch results. (I’m calling 1.4 and 1.2 seconds close.) It’s great to see that WebPagetest is capturing a pretty accurate mirror image of real-world performance.

Next step: DIY your own approach

If the idea of stopwatch timing appeals to you, I recommend mining your existing analytics and creating a methodology something like this:

  1. Identify key times of day for your business. Traffic spikes will give you a sense of how your pages perform under load. Traffic lulls will give you a good point of comparison against spikes.
  2. Identify connection types most used by your customers. If most of your customers are using DSL, then test from home. If a significant number of your shoppers are coming from mobile over 3G, then get out there and test for that.
  3. Identify the most popular browsers used by your customers. You might love Chrome, but if your customers are using IE8, then that’s what you should be focusing on.
  4. Identify where your customers live. If you’re in New York, but your customers are in the Midwest, find someone on the ground in the Midwest to test for you.
  5. Create a schedule for running your tests. It should go something like this: “At 10am, 2pm, and 9pm ET, I will test URL X 10 times on each of the following browsers: Firefox 6, IE8, and Chrome 19, as well as on the iPad 2′s native version of Safari. The 10am and 2pm tests will take place in an office over T1 and Wifi. The 9pm test will take place at home over Wifi.”
  6. Perform these tests over a meaningful amount of time — at least three days, ideally a week or longer.
  7. Grab the median result for each set of tests and plot in a table.
  8. When the test period is over, analyze. Compare to your fancy RUM data.

Stopwatch timing across a flow or transaction

Measuring on a per-page basis is interesting, but it doesn’t give a complete performance picture. 96% of your page traffic is part of a flow view, as users journey through your site, and how a page loads within a flow is not the same as how it performs during a standalone page view.

It’s not enough to make landing pages and product pages fast. Checkout speed is crucial, too. 18% of abandoned shopping carts are due to slow performance. In a controlled experiment in which just one page in a checkout process was slowed down, the conversion rate took a 60% hit.

There are a couple of lo-fi ways to get a hands-on look at flow performance:

  1. Identify a sequence of pages that takes you through a transaction up to the credit card authentication process. Use the methodology above to test each of these pages. Aggregate the results and note where slowdowns occur. This process won’t take you through authentication, but it’ll still yield meaningful results.
  2. Time the entire process, from product page to checkout. This next idea is borrowed from one of Strangeloop’s ecommerce customers. In the early days of information gathering, they gave us a company credit card, which we would use to “shop” on the site every day. The transactions were automatically nullified (which was too bad, because we picked out some really nice things ), but we were able to complete the transactions and get a really neat ground-level performance picture. I’ve always wondered why more ecommerce companies don’t make it part of someone’s job description to do this a few times a day, clock the results, and chart them over time. (If your company does this, or something like this, let me know. I’d love to learn more about it.)

Conclusions

I get a thrill at the thought of billions of RUM beacons gathering tonnes of data for me to slice and dice. But I also like to get a tactile sense of how a site looks and feels. While I’m a huge cheerleader for our friends at great companies like New Relic, who are out there making this technology better by the day, I still believe there’s a lot to be learned from taking a lo-fi approach.

Related posts:

WebPerfDays follow-up: 36 questions about web performance tools, measurement, and best practices

Today’s post is kind of like those blog posts where people answer random questions about themselves. Just a bit geekier. :)

When I was at WebPerfDays last week, I was walking past the ubiquitous board of post-it notes and started thinking about the fact that at every conference, so many of those questions and ideas go undiscussed. So I decided to snap each one and have made my best attempt at answering every question.

Before you read these, a big caveat: With many of these questions, the answer really depends on the situation. I’ve noted this where it’s particularly relevant, and given general answers everywhere else.

1. Why are Google Analytics so slow? Watch page loads – it’s always waiting on Google.

If you use the right script it should not affect your users.

2. How much impact can be made by optimising CSS selectors and does this have a trade off with maintainability?

Very little for most pages.

3. Do mobile networks do their own TCP optimization to devices?

Yes.

4. Can performance + webfonts coexist?

Yes.

5. Experiences with Android web driver?

None.

6. Will HTML5 make things worse?

Yes.

7. How build and deployment shapes our software architecture at thetrainline.com?

Don’t understand this question. Anyone?

8. GeoDNS versus Anycast Servers

GeoDNS.

9. Can we make significant improvements in website performance without further improvement in browsers or protocols?

Yes.

10. ASP.Net server side instrumentation, analysis, and interpretation

Ask Richard Campbell.

11. Pros and cons for loading 3rd party JavaScript in head/footer best practices

Footer, if possible.

12. Should I use Google or Microsoft CDN for my JQuery, JQuery UI, etc. references or host them myself?

Either. Shouldn’t matter much.

13. Offline and embedded web COAP

Nice and lightweight — functional enough?

14. Large companies and embedded web

Complicated.

15. Have there been any studies of how good Time To First Byte is as an approximation for true server time? e.g. DNS, connection time

Yes: here and here.

16. API performance

Important.

17. GEO – Distributed

Can be complicated. Do you really need it?

18. Responsive image format

There’s a group working on a standard.

19. Using web analytics to identify (and fix) web performance issues

I love it. See here, here, and here.

20. Metric-driven development

Does any other type warrant discussion?

21. No SQL Scale and Speed and survey of options

Not my area of expertise.

22. CDN vs. web proxy in some datacenters

Can someone clarify this question?

23. What is the best way to get customers interested in web performance when their website or web apps don’t sell stuff?

Find a metric they care about (e.g. productivity, retention, bandwidth), and I bet it connects back to speed.

24. Tonnes of great stuff at Velocity – what do you start with?

Measure your performance on WebPagetest. Iterate and measure again.

25. How many users is enough? When and what to deploy web KPI – new tech release schedules and users based?

More more more.

26. MVC JavaScript (backbone)

It works.

27. How many data centres?

Do you need the complexity of two, or is it for your ego?

28. Continuous delivery versus bureaucracy

Easy to say, hard to do. Do A/B development: put together a team of both and see who enchants the business.

29. Do the radios in 3G dongles behave the same as phones (from sleep to work)?

I would assume yes.

30. Fave perf. tools and what is missing?

See Steve Souders’s post for tools. Missing: Resource timings.

31. Discussion on what is the best timer to measure onload, first interaction, anything else? Multipage times

All of it. Correlate to biz metrics.

32. What are the best RUM tools?

Boomerang is a good place to start.

33. Has anyone used lo-fi RUM (stopwatch timing etc.) to validate their collected metrics/KPIs?

Yes. I should write a post about it.

34. Best way of building performance testing into CI build?

Script WebPagetest or HTTPwatch or Web Page Speed.

35. Continuous performance analysis tools

Take a look at WPT Monitor.

36. Should we expect FEO as standard feature of our CMSes?

Yes. Basic features by 2014. CMSes are usually two years behind.

For the sake of expediency, most of these answers are really short. If you want elaboration on anything, let me know in the comments.

Related posts: