Every user got faster. The average got worse.
My favourite performance story, and the part of it that usually gets left out.
Contents4 sections
Around 2009, Chris Zacharias cut YouTube’s watch page from about 1.2 MB to 98 KB. The project was called Feather. He turned the new page on for a fraction of traffic and waited a week.
After a week of data collection, the numbers came back… and they were baffling.
The average aggregate page latency under Feather had actually INCREASED.
He wrote the story up in 2012. He published no overall numbers and no chart, so the next figure is a model that fits his words, not YouTube’s data.
He tested it in browsers repeatedly, and “nothing made sense.” He was close to giving up on Feather when a colleague found the answer. It was geography.
The usual explanation needs too many slow users
The new page drew “a disproportionate increase in traffic” from Southeast Asia, South America, Africa and “even remote regions of Siberia,” all with slow connections. The usual explanation is that the mix of users changed. People on slow connections could already load the old page, and now more of them showed up.
The model below starts with 2 groups of users, one in a fast region and one in a slow region. Switch it to the 98 KB page. Both groups get faster (5 times and 8 times), and the average gets faster too. That is the opposite of what he saw!
Can a page get faster for everyone and slower on average?
Model, not YouTube dataThis is the 1.2 MB page. Switch to the 98 KB page.
5 things he wrote
Average, all loads: 4.40 s. Slow region: 44 s. Slow share: 1.0%.
Now drag the slider to raise the slow region’s share of traffic. You have to go all the way to 77% before the average gets worse than it was on the old page. Every group gets faster and the average still gets slower. That has a name, Simpson’s paradox. But 77% of traffic from the slow region, in one week? I find that hard to believe.
The new users had never been counted
In the slow regions, the average load under Feather took over 2 minutes. So the old page took over 20 minutes there.
A page that takes 20 minutes is a page you cannot use.
So these were new people. They could not load the old page at all, and the old average never included them. In his words, “Large numbers of people who were previously unable to use YouTube before were suddenly able to.”
Set the slider back to 1% and add new users from the slow region instead. The figure checks the model against 5 things he wrote. All 5 now hold, and every user is faster. The average goes from 4.4 s to 6.6 s, and the new users are only 2.9% of loads! With the old users alone, the code would have cut the average to 0.85 s.
Which of those last 2 numbers would your dashboard have shown you?
Why the slowest users were missing
Real-user monitoring (RUM) can’t see people who give up. A page sends its timing beacon once it reaches first paint, so someone who leaves before that sends nothing. The slowest loads never show up in the data.
In 2020 Chrome’s speed metrics team measured how often slow loads are abandoned. They describe this same trap, where “a performance optimization causes more of the slower page loads to no longer be abandoned and hence could be perceived as a regression.”
What does RUM see when a page stops losing its slowest users?
Model, not measured dataCut the page size and watch the RUM average.
Reached first paint: 31 of 40. RUM average: 7.10 s. Average if all 40 had waited: 105 s.
The model has 40 users. Cut the page from 1.2 MB down to 98 KB and every one of them gets faster. The loads that reach first paint go from 31 to 40. And the RUM average still ends higher, at 9.25 s against 7.10 s.
What to report after a launch
In 2023 I got fooled by a speed number myself. I tried a tool that moves third-party scripts into a web worker, and the first numbers looked great. Then I found the scripts had never loaded! Of course the page was faster, it was doing less work. I retracted the result and left notes for whoever picked it up next.
So when an average moves after a launch, check who is in it before you credit or blame the code. Then report 3 numbers instead of 1:
- The average your users actually saw.
- What the code did, with the old mix of users held fixed.
- How many people you reached who could not load the page before. You can count them from the attempts in your server logs.
For the second number you keep everything the same except the code. In 2023 I did something like this at work, for one of our slower sites, the one for a South American country. I compared an image of the same size there and in the US, so page weight couldn’t be the reason. Users there still waited about 3 to 4 times as long, and that was the network.
In the first model, the third number is 3,000 loads. Those are the people Feather reached for the first time, and the average counted them as a regression.