Well, that’s weird…
Opening a casebook of web performance surprises
The host introduces Harry Roberts and highlights his contributions to web performance. Roberts describes how years of consulting shaped this collection of debugging stories and explains that he uses illustrative figures in some cases.
How a French-language campaign moved LCP
Roberts traces a client’s Largest Contentful Paint regression to a surge in traffic from French-speaking African countries. The client had intended to advertise in France, and correcting the campaign targeting resolved the regression. The case shows how a shift in who visits can change measured performance.
Measuring the conditions visitors actually face
Pitchup’s seasonal slowdown prompts Roberts to look more closely at the conditions visitors face, including when they browse from campsites. He introduces obs.js as a way to enrich real user monitoring with browser signals and describes how connection conditions can guide choices about images and fonts.
More cache misses made the site look slower
Roberts segments a Time to First Byte regression by device, geography, and CDN cache status. Cache hits and misses each got slightly faster, but server-side personalization had disrupted cache keys and increased the share of slower misses. Reverting the change restored effective edge caching.
The CSS experiment that p75 nearly buried
A concurrent test of bundled and split CSS showed virtually identical LCP at the 75th percentile. Roberts explains how to read a cumulative distribution function and uses it to show where the two cohorts diverged. In his illustrative figures, bundling improved LCP by 1.5 seconds at the 90th percentile.
Control the calendar and check the test runner
Roberts uses the ANWB route planner to show how whole-week comparison windows balance weekdays and weekends, and he advises excluding release day. He then traces a sudden improvement in his own synthetic tests to SpeedCurve’s Chrome upgrade. Changes to Lighthouse and CrUX illustrate why he checks measurement changes alongside site releases.
The 104-millisecond clue in a two-peaked INP chart
Roberts investigates two peaks in an Interaction to Next Paint distribution and finds that the split persists across mobile and desktop. A valley near the Event Timing API’s default threshold leads him to a SpeedCurve collection bug that omitted fast interaction entries. Once SpeedCurve fixed the bug, the reported figures looked worse.
When the Total Blocking Time window widens
Roberts explains how First Contentful Paint and Time to Interactive define the window for Total Blocking Time. An extra request delayed Time to Interactive, and the longer window produced a large metric spike alongside a small increase in long-task activity. He recommends plotting all three metrics together to make such shifts visible.
Zeros, rare redirects, and one bad day
Roberts removes zero Time to First Byte values associated with soft navigations and finds a stronger correlation with LCP. He uses a redirect case to show how frequency changes the priority of an expensive event. He then revisits his own advice on performance budgets after a single outlier leaves far too much headroom.
How a faster shop can look worse at converting
Roberts explains how concurrent, randomized A/B tests expose both cohorts to shifts such as seasonal demand and advertising campaigns. In an illustrative webshop example, new and returning shoppers each convert better on the faster site even as the combined conversion rate falls because the visitor mix changed. He closes by putting site speed in the context of the other factors that drive sales.
Harry Roberts is one of the most generous people in web performance. He has contributed so much in terms of excellent blog posts and conference talks and social media content. All stemming from his incredible expertise as a web performance consultant. Okay. Now the sad thing, at least for me today, is that Harry is also by far the tallest person in web performance.
There is really no one that even comes close. So I was thinking you know Harry doesn't he doesn't really need a pointing device.
Where is tiny
Tim? He can just he can just reach the screen by himself. But I I didn't want Harry to be the only speaker sitting here empty handed. Okay. So I found like the the shortest, the smallest weapon I could find.
You're certainly a tiny one.
Which which is this. This is something called a rondelle dagger. Okay. This was actually used, it's it's like an ice pick form as you can see and it used to have a very sharp very sharp tip. This was actually used in fully armored combat. Right? Two knights going at each other in full harness. And that's why it is actually still quite long for a dagger.
Because the idea is you can put this in the neck like this and slide it all the way down behind the breastplate still hitting the heart and killing the opponent that way. And it also works if you come here under the ribs, beneath the breastplate you can also hit the heart like that. And so I thought Harry this was actually very appropriate for you, because through your generosity you've hit the hearts of many of us.
Oh, thanks.
Thank you, mate.
So with that, we are going to go to last speaker, Henry, who has chosen a title for his talk that describes not just the content but also the speaker himself. So let's take it away.
Well that's weird. Speaking in Amsterdam, I'm wondering where you borrowed this one from. Right. So has anyone noticed you're all sat on gravestones? Because has anyone noticed that? Won't be the first time I've spoken to a dead audience then, will it? Nah, it's part of it. So anyway, this is a huge huge talk and it doesn't really have a beginning, middle and end.
It doesn't have a nice story arc. This is just a huge compendium of just weird things. I've worked in the web for a long long time now and in that time, you're guaranteed to come across some weird stuff. And I've just got a carpet bomb sort of like scattergun approach to just story after story after story of fun little things I've seen, heard and learned about web performance that I think you might like as well. Now if you would like to keep in touch, you can find me at CSS Wizardry everywhere.
That's socials and my website which turns nineteen years old today. Which is a terrifying thought. When I was 17 years old, had to borrow my mom's credit card to buy the domain because I couldn't do it myself. And yes, so the worst domain on the web turns 19 today. CSS wizardry. Yeah. I'm Harry.
I'm a consultant performance engineer from the North Of England and I'm a very, very fortunate bloke. I'm a very fortunate guy because I get to work with clients like these. I get to help clients like these find and fix site speed issues. Now I've been doing this professionally, unprofessionally, for about thirteen years now and in that time you do see some really odd things. So what I've tried to do is cast my mind back, maybe not a full thirteen years but things I've seen in the last at least several years that have either taught me something, made me laugh, made me want to cry, just odd things that have either just been amusing or or taught me something valuable and sort of set me up for the next project, the next project, and so on. And I hope you get some value out of those stories too. Just a a word of warning.
Some of the work I've done has been under NDA or the data doesn't exist anymore. So all the stories here are gonna be based in truth. Some of the numbers may well be fabricated to illustrate a point. So please don't quote anything as being oh, this project had this many extra conversions. Some of it may just be completely fabricated to illustrate a point. It's really important I drive that home because I don't want you to see a before and after and think, well we'll do the same.
Right. This is a huge talk. Like I say, let's plow ahead. First story, hopefully shouldn't be too controversial. French is not France. This this story actually happened this year. I've got an existing client. I've worked with them before. They're a very performance, a performance conscious client. When I will, in our work together, we calculated their sort of sweet spot LCP for for conversions.
And around spring of this year, from sort of March to mid April, LCP started regressing and it regressed way beyond what they would see as their sweet spot. And they panicked because they know how much site speed means to their business. So they messaged me saying, Harry, we don't know what's happened. The site's getting slower. And I said, well you don't know what's happened but you know, what has changed? They were like, honestly nothing.
We've had no migrations. There's no major release. No big fundamental change to the application. We haven't had any obvious issues. No outage. No downtime. No problem with sort of CDN pops. There's nothing we can think of that may explain this problem. And I guess the the first takeaway I've got is something always changes. Something has changed.
You just haven't found it yet. And site speed sometimes like kind of exists between us and our user. It's not wholly owned by the code base. It's not wholly owned by the audience. Site speed is a function of many different things. One of the obvious places to start looking, we don't think it's us, is the audience. So looking at everyone's favorite trio, February we could see that it's kind of unremarkable. This this is a UK company.
They conduct most of their business in Europe. Maybe some of some North America. Step forward a few weeks into March and Africa starts getting sort of slower. It's getting more more traffic and that traffic is slower. Yep. Europe's got a little bit slower too but Africa's now literally on the map. Step forward into April and and it's really overrepresented and it's slow in every region on the on the screen right now. It's this is definitely an audience mix problem.
But the odd thing is my client doesn't do any business in Africa. So what was going on? So I just straight up asked them, are you expecting this much traffic from sort of Northern Africa? And the entrust to... The answer was, we're not. They had no idea what was going on. So I said, well can I speak to somebody else in the business who might be able to help me?
Someone in analytics or your data or your customer business insights? Can I speak to someone who might know? And after the one after a while I got to the bottom of it. There are two maps on the screen now. The first is the LCP data from Crooks. Can anyone guess what the other map is showing? What these two maps have in common?
Just anyone's got any guess, just shout out. French. These are French speaking countries in Africa and when I went back to the client with this and I told them, hey, so all of the countries that are getting represented, either coincidentally or not are French speaking countries. And they said, ah, we are running a quite an aggressive ad campaign in French speaking countries.
And I said to them, did you really mean to be just doing France though? And they were like, yeah. Yeah. We should have done France. The double whammy here of course is they were spending money advertising to sort of like non not even non committal like very unlikely buyers and tanking site speed in the process. It's like a triple whammy, sorry.
So we simply scoped the ads to France rather than French speaking countries and the problem went away. Amusing thing left on screen right now though is that I think they might be doing for the same for Spain and Portugal. Anyway, on the nineteenth anniversary of registering csswizardry.com, perhaps I should rebrand to webperfpedantry.com because I am a pedant.
I nitpick things and I do think that's, it can be annoying, you pick your moment but I do think having a shared understanding of very deliberate wording and deliberate phrasing and definitions can solve a lot of problems. So one of the first things I go through with my clients is these numbers here, these numbers here, even these numbers here, none of these represent how fast your site is.
They fast, they represent how fast your site was experienced. So the first major takeaway I wanna give from this section is web performance happens somewhere between you and your visitors. And as a result, sometimes it really is a them thing. So the next section sort of builds on this. Sometimes it's a them thing. Even if it is a them thing, you've got a responsibility to design to them but sometimes it's not a problem owned by you.
A cheap rhetoric we often get in this industry is, well what if your users are in the middle of a field? For this particular client, sometimes they literally are. This is a client of mine, Pitchup. Pitchup is like booking.com for campers. And they got in touch with me and said, our site slows down around the summer holidays.
No it doesn't. Your site doesn't know it's June. Right? Your site isn't in vacation mode. You're just getting more slower visitors. And this led me to sort of say to them like they know they've got, they know they trade seasonally. Right? They didn't just, they didn't literally think the site was slowing down but the way they worded it wasn't pedantic enough for me.
I was like, no no, your site isn't getting slower. You're getting more slow, sessions, more slow visits. So this led me to sort of realize I don't think we know enough about our visitors. Most RUM, most analytics off the shelf will give you rudimentary device information, browser, device type, screen size, geographic locale But there's loads more stuff that I would like to know about the context of our visitors. And using modern APIs, we can actually get hold of a lot of this. So a year or I think maybe two years ago, can't really remember, I built a little utility called obs dot j s. And obs dot j s taps into all of these APIs and it does two things.
First thing is it beacons or it can beacon the information off to whatever analytics endpoint you use. So for me, I I tend to use SpeedCurve quite frequently. I can segment based on device capability or or whatever sort of I may have called it. I can segment based on what hd protocol did that customer have. Were they using gzip, broccoli or zed standard?
The other thing I can do or one could do and we did for a pitch up is design adaptive experiences. So you could have a light mode that is keyed on things like latency and bandwidth. And you might serve low res images and system fonts. Because remember, source set and sizes and media queries, they use screen size which is a terrible proxy for connection speed.
Right? If you tap into the relevant APIs, you could build adaptive experiences. We can have the op... You have the rich mode which could but you wouldn't obviously have auto playing video. You could use high res imagery and you could even preload your web fonts and so we're confident enough we can throw those down the wire first.
Then for everything else, we could just opt in a bit more cautiously. One thing we learned on the pitch up project was that people with low battery tend to convert better. That you can infer from that perhaps a sense of urgency like, oh my battery's gonna die. Need to do something. The obvious dark pattern that emerges is that in a web worker, start spinning up some really expensive job.
You wouldn't do that of course. But the numbers that you read on whichever dashboards you're looking at represent far more than just the site. It represents the context in which it was viewed. And sufficiently mature RUM tooling will grab that information for you but for your tooling that doesn't, complement it with your own heuristics and your own sort of data and learn more about who is visiting the site. Now this is one I've hinted at already but more slow visits, no slower visits.
This was a really interesting one from I think just a matter of weeks ago, maybe a couple of months. Time to first bite is getting worse and we don't know why. A client got in touch with this simple request. It's a client I've worked with before and we tend to know at this particular company. If time to first bite gets worse, LCP is gonna show a corresponding degradation instantly. The correlation is near one to one.
So time to first byte is an early warning system for this client and it did. It sort of it's peaked and you can tell I've taken these screenshots after the fact because we got on top of it and we found the problem. We fixed it. But you can see time first byte peaked and I was contacted roughly then.
Intuitively, because I've worked with this client before, I had an inkling that while time to first byte is usually increases, sorry, are usually caused by increased server response. It's never usually down to DNS. It's never usually down to end user latency. It's almost always down to server response. And you can see these lines virtually hug each other.
So how do you start debugging this? Well you start segmenting on things. What makes this problem go away? Now I've just told you this is server response. So the next two slides don't make sense but I have to illustrate the point somehow. I know this is a back end problem so segmenting on device type doesn't make any sense but I'm just using it to illustrate a technique, a workflow.
Segmenting on mobile and desktop, the problem still remained. So the problem couldn't be explained by a difference in those things. It wasn't a mobile thing or a desktop thing. It couldn't be explained by that split. It literally couldn't because it's a back end thing and the server's got no idea what the device is but my point still stands as an illustration. So then I thought, well is it a geographical thing? Does the server get out of bed slower if it knows it's a German visitor?
Of course it doesn't. But my point still stands. The problem hasn't gone away, therefore it cannot be explained by a geographic split. So then I split on CDN cache status and the problem goes away. This means that something in here explains the problem. As soon as the problem goes away, you're onto something. You've found something that explains the problem.
Now when you actually run the numbers, cache hits actually got marginally faster over this period. Cache misses also got marginally faster over this period. But back end times got worse. It wasn't the actual severity of the hit or miss. It was the frequency of them. We were getting more misses than hits.
It wasn't that anything had actually slowed down. The site hadn't actually gotten any slower. We just had more slow visits. We were serving more cash misses. If you look at where these two lines almost converge, went from having vast majority, vast majority of the red was was hit and the oranges come up to virtually converge.
We then tracked down the problem and it turns out it actually was a no's thing. We were doing some client side, oh sorry, server side personalization. It was busting cache keys. We're losing our effective sort of edge cache. We solved the problem. We reverted it. So I guess my takeaway here is a change in audience or change in population I guess is the more technical way of putting it.
A change in population may explain a change in the numbers. Or like the kind of twee title of that section, No slow visits. Sorry. I can't remember the name of it. What was it? No slow visits, more slower visits. That was it. Next section. Faster for who or whom? Ryan Townsend is the only person I know who knows when to use who and whom properly.
Faster for whom. This is a really good sort of tale about almost throwing away some really good work. Web performance is more than a single number and people have been saying that ever since Lighthouse was invented. We know this. Web performance is more than a single number. It's also more than a single percentile and that's the I'm gonna loop back to shortly.
Had a project and this is a project for which the numbers are illustrative. But I was working with a client. A few years ago I'd written a an article in which I did some some research. Do we still need our build tools? Is it faster to bundle your CSS into one big CSS file or is it faster to split out into many smaller ones?
Can we start abandoning concatenation and build build tools? I ran some synthetic tests and the resounding answer was that it is faster. There are trade offs but it is faster to put all your CSS in one big file to a tune of, what was it, four hundred and thirty milliseconds in these synthetic tests. But these are only synthetic tests and this failed to take into account a lot of other variables.
So my client and I, we ran a concurrent test and we gave 50% of the cohort bundled sort of monolithic CSS. The other half of visitors got given split apart, non bundled CSS. After a month, LTP remained virtually unchanged. They they they were identical. P 75, LTP turned, well it didn't change at all.
So just by a show of hands, do we think this is worth the engineering effort? Who thinks this wasn't worth the effort? Nothing changed. Took us a month and nothing changed. Okay. Smart room. Who thinks it was worth engineering effort? I'm gonna be a bit of a dick. There's a third option you didn't know about. Who thinks we don't have enough data yet?
Alright. There we go. Yeah. Forget your first two options. Who thinks we don't have enough data yet? Right. Exactly. So Tim covered this really nicely for me so I won't dwell on it too much. The seventy fifth percentile basically we say, oh no, sorry. I've been talking about this for years. I don't think the seventieth percentile is ambitious enough.
I really don't. You got a 100 visitors and you're saying, well we care about these 75. This lot can get lost. That's not good enough. Run vision switched to p 90 by default, I believe the end of last year. So if you want your TIM mode, you've got it. So I think saying that one number is not representative is is still correct but I'd go further to say one percentile, looking at one percentile is still a little reductive.
My friend Andy Davis and I worked on a project ten years ago and he showed me a type of graph called a cumulative distribution function. CDFs. Anybody used CDFs at work before? Unreal. So for those who haven't, you you're gonna love this. These are amazing. You're used to seeing histograms per hopefully, perhaps seeing histograms. So these show, in fact imagine you own a cafe and you say, on Monday we serve 10 customers.
On Tuesday we serve five customers. On when on Wednesday we serve 10 customers. You could say, by Monday we'd serve five. By Tuesday we'd serve 15. By Wednesday we'd served 20. That's what you do is you take all your buckets and you actually add them all together until they sum to a 100. This is the same data plotted cumulatively.
And then to make it a little more easy to read, you replace the bars with a curve and you get this. So the experiment we ran to see if bundled CSS or split CSS was faster, we plotted as as a CDF. The TLDR is that when you compare two populations or two lots of data on a CDF, any line that is generally speaking in web performance, any line is either higher or to the left of another line is better.
So you can see here in a very broad simplification, blue is better than yellow and blue here was our bundled CSS and yellow was our split CSS. The way you read a cdf, you've got two options. You can pick the percentile you're interested in. So seventy fifth percentile for example. You read in, then you read down. And what you get out the other end is at the seventieth percentile, LTP was just under two point five seconds.
So you can see that for this experiment, at the seventieth percentile, there was no change. This work looked ineffective. The other way you can read a CDF is start at the number, the value you're interested in and read up. So by three point five seconds, we had catered to 86% of our audience. This is probably the nerdiest thing I've ever said even on stage but that's beautiful.
Like this allows you to view all populations at once. All percentiles at the same time. So what we found was really interesting. At the ninetieth percentile, the experiment yielded a result that showed us that a big bundled stylesheet was one point five seconds faster. So now I'll ask you again, was this was this worth the effort? Yes. A 100%.
A CDF allows you to view every percentile at once. So whether you're benchmarking the seventy fifth or the ninetieth, a CDF will show you all of them and it will show you drifts and it will show you advantages and CDFs can cross where you know a a certain percentile one cohort was better but another percentile, the opposite is true.
They're really beautiful ways of visualizing data. And if you wanna learn more about these, Farid Zakaria wrote an amazing article about this and more only early this year. The slides are already online. I've forgotten to put a citation on this I'm afraid but if anyone wants to grab a quick photo of this, the article is wonderful. Oh yeah. So don't just look at one percentile before judging success.
CDFs plot the entire population at once. This project could have thrown away really valuable work by not looking at all possible permutations. This one's a really quick tip. This is a bit of pit stop really for me to take a breather. This is a really neat one that once I say out loud, you'll just be like, that's so obvious.
Whenever you're looking at before and after comparison and before and after comparisons are fraught with problems, we'll come back to that anyway, later. When comparing a before and after, always compare a multiple of seven days in the before and after observation period and omit the day of the change itself so you're not counting any noise caused by the release. It's best to illustrate this I think with an example.
If you live in The Netherlands, you've probably seen, probably used the ANWB route planner before. Now let's say, oh I I don't know this as a fact but I could reasonably assume that a route planner like this is gonna have more traffic on commuter days, weekdays, than on weekends. People are checking, are there traffic jams?
You know, what are the, what's the traffic like? How long is it gonna take me to get to work? Is there anything I need to know about? I would posit this site gets more traffic on a weekday than on a weekend. So if we sort of rolled a release, deployed something to route planner on a Tuesday, then decided okay we'll do a three day before and after comparison.
I've captured two weekends or two weekend days and a weekday. And I'm able to compare that against three weekdays. By simply expanding that observation period to seven days, I get one of each day of the week. And it's so obvious when you hear it explained to you that just by using multiples of seven days, you get an equal number of days of the week in the comparison.
It doesn't have to be seven. It could be 14. Certain run providers just default to a month. And a calendar month, if your site is kind of affected by days of the week, a calendar month is gonna have a slight bias one to the other. Always pick a multiple of seven days. Yeah. Okay. This is an interesting one where it comes back to things that have been, it's been a really great first day by the way. We've learned so much and a lot of what other speakers have talked about, I can kind of like call back to in in my talk.
We've looked at this kind of thing already throughout the day where we look at the actual quality of the tests we're running. It's the exact same file. I mentioned this at the top of the talk. Something has to have changed. A number on a dashboard's changed, something's changed. And it might take you a long time to find out what it is. Like it did in this example that I'm about to show you that something has to have changed.
So my site, and this screenshot's from about two years ago. My site, I use SpeedCurve to just run a few synthetic tests every day. And around sort of late July one year, t total blocking time got way way better. Just way way better and it stayed better which was great news but I had absolutely no idea why because I hadn't rolled a release. I hadn't published anything.
I hadn't changed the site at all in the observed time frame. So my next thing was like, well third parties might be a good place to look and sure enough, Twitter's own SDK got markedly faster during the observation period. So I could surmise that okay, Twitter's SD, and it's the only file that got faster. Twitter made some improvements to their SDK and it's made my site faster. That's brilliant. But they don't or didn't publish release notes.
So I didn't know what was happening. So I tried to use SpeedCurve's web page test instance to work out what may have changed. But the e tag, I wanna split between these two slides. It's the exact same file. It's byte identical. But something must have changed. Something has something has to have changed. And this took me an embarrassingly long time to work out.
But from day one to day two, Speedcurve upgrade their agents from Chrome one one five to one two six. So sometimes it's an Us thing, sometimes it's a them thing, and sometimes it's a test thing. And if you're not careful, sometimes you're just testing the test itself. Now the reason this becomes particularly important for us in this room this week is that light, lantern, the sort of tooling inside of a lighthouse, has changed its algorithms.
Which means that it's highly likely that a lot of site's LCPs imagine magically gonna get faster as per their lighthouse tests just because of a change inside of Lantern. It's not necessarily to do with the the code or anything you've changed. There is every chance that tens of thousands of people out there, sites, monitoring, whatever, are gonna get better LTP scores because of a change inside of Lighthouse.
Crooks is about to start including, or is experimental including soft navs. And soft navs have already started to show improvements in the data there without the sites having to change a thing. So as a matter of course, any time I do a comparison, either before and after or cohort a, cohort b, I always diff the test environment as well.
Make sure I'm testing real like for like. With run data, or actually even with synthetic, I've now got a cron job which actually checks for browser releases and also speed curve SDK or speed curve browser agent updates and uses the speed curve API to add them as notes on my chart. So I can see a change in data could correspond with a change in speed curves test agent.
So make a clear note of changes to your test setup. And if you see anything that isn't explained by either the code or the population, start checking the tests. Alright. Bimodality as a bug. This is just an interesting really recent story. It doesn't yield much of an outcome other than this was really weird. INP and the red herring.
I found a bug recently and it's been fixed. It's been responded to And it was also a very, very, very, very, very minor bug. But it confused me for long enough that I thought I had to include it in this talk. So bimodality is when data or a population contains two distinct peaks in a distribution. Easier said with a graph.
This data is bimodal. It's got one peak here and one peak there. This is INP data for an entire site. We've got a cluster of a high proportion of tall bars in the very fast INP and a flatter, wider peak in the slightly slower INP. What might explain this phenomenon?
Just shout out. What might explain this phenomenon? Who said mobile versus desktop? That's the first thing I thought. Right? These are your more powerful devices and they're getting really good IMP because they've got more CPU and these are your slower devices because they've got more constrained capacity or or like on chip. Right? So that's the first thing I thought.
So I split the population on mobile and desktop and the problem didn't go away. So it couldn't be explained by mobile and desktop. Then the pedant in me was like, well mobile and desktop is just a form factor. It doesn't necessarily mean it's slower or faster on on the chip. But it wasn't that either. I started staring at its data so long that it started staring back at me and I noticed something really interesting.
That valley between the peaks, it lands suspiciously around a hundred milliseconds. Anyone who like me has memorized the performance event timing API will know that by default, it doesn't log anything after a hundred and four milliseconds. Hundred hundred and four milliseconds when it comes to INP and the well the event timing API, is a magic number.
These peaks sat either side of a hundred and four millisecond valley. Now SpeedCurve buckets its data into twenty millisecond things so it didn't have an exact one zero four millisecond bucket. That's why some of them straddle the actual one zero four. When I looked at the CSV, the problems the problem is they're clear as they. This was a bug in SpeedCurve.
A very, very minor bug and they addressed it within three days. But what I found really interesting is the way that the performance event timing API works and how speed curve worked about two weeks ago. Speed curve capture first input delay. It's deprecated by crooks and and and sort of the core vitals team. Well not deprecate but it's not a core vital battery.
So the metrics deprecate, tell you what, you take over. Now it's not it's not really of interest to us much anymore because it's been superseded, not replaced, but superseded by IMP. But speed curves still capture FFID. Now SpeedCurve's capturing mechanism, the little bit of Javascript that captures the event, was set up to opt in to sub one zero four millisecond events. So your FID at twenty four millisecond was captured.
A FID at one zero four milliseconds was also captured. However, there was a slight syntax error in the JavaScript that captured INP data that passed through the parameters, the options wrong to the API. So it had an undefined error but didn't really cause any other problems than that. Anything faster than a hundred and four milliseconds for INP was missed.
So all the one zero four and below were FID events and all the one zero four and higher were either FID or valid INP events. Now I've raised the bug. Joseph fixed this within over and within a weekend and it was so minor. Actually fixing the bug made the data worse. So I had to then email my clients and was like, I've been a snitch and it's cost you.
But yeah, sometimes it's an Us thing. Sometimes it's a them thing. Sometimes it's a test thing, and sometimes you really just can't trust your data. I would question yourself in that order. When you see when you see something fishy, it's probably your fault. If not, it's probably your user's fault. If not, your tests are wrong and failing all that, there's a bug that someone else wrote.
This leads me onto a takeaway that sort of stands sort of quite dear to me is know thy metrics. Subtitle for this section is read the specs. I worked with a client years ago and with no hint of sarcasm, he was and it probably because he was German, it was no hint of sarcasm. He said, Harry, your job seems really boring because all you do is read specs. And at first I was offended.
Was like, yeah, but you're paying me to read specs because your developers haven't. And nearly every problem I've fixed for any client I've had is because at some point I've read the spec. This served me really well on a client project a few years ago when they were panicking. This client was running both synthetic and rum monitoring.
And their synthetic tests blew through the roof one day. Their total blocking time went from four hundred and ninety five milliseconds up to five point eight seconds from day one to the next. And of course my first line of questioning is, what's changed? And they're like, nothing. We've not we've not deployed a meaningful release. We haven't done any like sort of node modules updates.
Third parties don't look to have changed. We don't have a load of, well actually it's not an audience problem either because this is synthetic data so you can rule out audience problems. What has changed? Now, I'm probably gonna get slapped by Barry again but time to interactive has sort of been deprecated. Because I read the specs, I know that unfortunately, total blocking time is defined by type two interactive.
So even though Lighthouse has whipped TTI out of the dashboards, out of the reports, out of the scores, total blocking time is still defined by TTI. I'll come back to that in the next slide. So intuitively, instinctively, I thought, well let's add TTI to the same graph and see if the the issue persists. So sure enough, I could surmise from this that I don't think you've actually got a TBT issue.
I think something that's happened to TTI is exposing a TBT issue. So total blocking time is defined by the very ill defined total, time to interactive. So time to interactive is defined as this behemoth here, this horrible chart here. All you need to know is total blocking time is defined by the amount of long task or the portion of over fifty millisecond long tasks between FCP and TTi.
This is what I refer to as the total blocking time window. What this means is if you were to add an async attribute to an a synchronous script in the head, you're gonna improve FCP. So FCP's gonna move this way a little bit. Which then could allow more long tasks to slip in to that window where you're getting measured.
You could improve FCP and thus LCP significantly and get punished by a worse time, TTA, TBT. So the total blocking time window is the time you're measured on between f c p and time to interactive. Because my client's t t I had slipped, all of a sudden the goal posts were way bigger. We're gonna try and illustrate it.
You don't need to be able to read anything on this graph which is just as well because you can't. Just eyeballing this waterfall, this is like fast TBT, this is slow TBT. Eyeballing this waterfall, they're the same. And there's not even a question mark on that. They are the same. There's very, very, very, very little difference. They're about the same length, about the same number of requests.
The hallmarks of sort of CPU time down here, it's all virtually identical. But because of one extra hp request which invalidated the quiet window for TTI, from day one to day two, in fact the problem specifically, if we can try and point it out, see there's a gap there between those two requests. Time to interactive requires no more than two in flight requests.
And as soon as that is encountered, can start counting back to a quiet window of five seconds. That gap doesn't exist up here. There are at least two... Oh no, does a bit there, doesn't it? Well maybe I've missed out where that gap was meant to be. Either way, the actual real effects from day one to day two, the the sight felt no different.
Before they were being measured on this window, after they were being measured on that window. Meticulously in Photoshop, I picked out every red pixel in that pages interactive bit and I put them side by side. I did it pixel by pixel and I measured them in actual fact like the actual long tasks from day one to day two was increased by, it did increase by 3%.
Total blocking time increased by 1169%. That is just an artifact of of the rules, right? That's just not knowing the specs. Oh sorry, not knowing the specs. It's the specs being defined in quite an esoteric way. I went back to my client and said, I wouldn't recommend chasing the numbers for numbers sake. You've had 3% more long tasks.
That hasn't been mirrored in your run data. This isn't affecting anyone. You've just got a really bad total blocking time now and I would recommend just living with it. And pragmatically, that's exactly what they did. There's no point polishing the numbers if the users are happy, right? So thus I coined the phrase total TBT window. Whenever you plot total blocking time on a chart, I would also recommend plotting FCP and TTI as well because any changes in any of those three lines could be explained by one of the others.
To best of my knowledge, Matt at DeepbugBear is the only run tool, the only tool that has this as a first class citizen. If any other tools have done that, please let me know. I'll add you to the slides. But your TBT window is just a sense check. If your TBT window has changed, that might explain a change in the metric rather than any change in the experience itself.
Right. Slide a 117 of a 169. How fast is a response that never happens? This is a weird one. This isn't a bug but it felt like one at first. So the subtitle for this section, when zero really means no. A lot of web APIs return a zero when they should return didn't happen. This affected me recently when I was trying to get some data over to a client.
I love correlation charts. I also Martin mentioned it as well. Causation and correlation, it's vital you understand the difference, right? Sites don't... But I'll come back to it. I'll come back to it. But I'm not saying that causation and correlation is something you definitely need to know when you look at correlation charts because you can't always guarantee that one caused the other.
They just correlate. But I still like to go to clients and be able to say things like, for every additional x milliseconds of time's first byte, LTP gets x milliseconds slower. This allows you to start quantifying your sub metrics, your sub parts. So when I was eyeballing this graph, I was like, it was very clear positive correlation there.
I couldn't put a spearman against it. I couldn't, you know, I'm not that good. I just thought, there's obviously some very clear positive correlation there. So I did. I ran the numbers and I got the Spearman correlation coefficient and it was just point five. For those not familiar with the coefficient, negative one is perfect negative correlation. Plus one is perfect positive correlation.
This is actually relatively high positive correlation but eye eyeballing the graph, I was expecting it to be much higher. Yes. So I went back to the data to try and work out why. Why was this correlation mathematically way off what I'd have assumed it would have been? I noticed this fishy little fella here, this huge huge bar, and this isn't a bug, this huge bar in speed curve, this bucket counts zero to zero point two second time to first bytes.
You can't have a zero second time to first byte. You can have no time to first byte You can't have a zero second one. But web APIs, and it's even recommended that the the Core Web Vitals library, they recommend you count zeros for soft navs and it's it's part of the spec. This isn't a bug but it is a weird data artifact.
You can't have a zero second timed first byte. You can have no timed first byte but zero should really be counted as null in in my opinion. So what I did, and it's not a bug but speed curve still solved it for me, I just set a metric threshold and said, oh by the way, I pushed this to point zero zero zero one and it still gave me the same graph output.
So I said just give me any non zero time to first bytes. We lost about 835,000 data points from that first bucket. We had eight hundred and thirty five point eight thousand zero milliseconds time to first bytes. Soon as we removed those, the data became way, way more, I don't know. Don't know, I don't wanna say confirm my suspicions because it shouldn't happen that way around.
But by removing zero counts, the correlation coefficient was point nine. This gave me a really high confidence that in sessions that incur a time to first byte, that has this much impact on your LTP. So I could go back to my client and say, for every additional hundred milliseconds of time to first byte, you could expect LTP to go be knocked back by eighty seven milliseconds.
So I guess my takeaway here is if a metric is significant, only look at events where it actually happened. This is a scenario where I believe time to first byte zero should have been null. It isn't. The spec says it doesn't have to be. So use other means to trim out suspicious or misleading zeros. Any REM fans in the room?
I really have to shoehorn this title in. So this is all about frequency and I believe this has been mentioned once already today but it's all about it's really important to look at how often something happens rather than just how bad it is when it happens. So redirects are killing us. A client told me this, I can't remember when but a client was like redirects are killing us.
And I looked at the data and sure enough a redirect costs almost the same as the back end time. Two hundred and sixty milliseconds for a redirect, two hundred and eighty milliseconds for the entire server think time. So yeah, think redirects are really expensive, comparatively at least. This is a time series. This tells me the severity of metrics but it doesn't tell me the frequency. This doesn't tell me that every time you get a server response you also get a redirect.
So what you do is you plot it differently. You plot it as perhaps a distribution. And what happened here is redirects were so infrequent you can't actually visibly discern them on the graph. So I told my client, this is nothing to worry about. Don't worry about it. For every a thousand recorded observations we recorded a thousand server responses.
We didn't get a single event without a server response. Out of a thousand recorded events, we only got 14 redirects. Or put another way, a redirect happened once for every 73 server responses. So yeah, redirects might be expensive but happening so infrequently, I wouldn't put budget behind fixing this. It sure certainly shouldn't be a high priority. So frequency matters just as much as severity.
Right. Performance budgets. One bad day that almost bought us ten seconds of headroom. I've been running some workshops recently, where one of my own mistakes got pointed out sort of back at me. Not maliciously, not at all, very kind actually but one of my own mistakes when defining performance budgets was sort of highlighted back at me. Many moons ago, before Core Web Vitals even existed, so actually reading this article back I talk about page weight and CSS bytes and all that kind of stuff.
But I wrote an article about performance budgets in which I suggested, that when you're setting a new budget, take the worst data point in the last two weeks and use that as your upper bound, your limit. I was doing some workshops and one of the attendees said, well doesn't that leave us susceptible to outliers? And they were absolutely right because for some reason on the November 4, my site had a really bad day.
But if I was to set my performance budget based on this last two weeks, sweet. It's thirteen point two seven seconds. I can take the rest of the year off. She was absolutely right. This left is really susceptible to outliers. It's not on appropriate or representative budget. So I reworded the article to say pick maybe the ninetieth or ninety fifth percentile of the last period's events and use that.
I don't have a link to it. If anyone wants a copy of this, buy me a beer and I'll give you a copy of this. You can just paste your performance data in and this will give you the p 90 or it'll suggest you a performance budget back. So for my data for that, for this slide specifically, the p 90 is three point zero four seconds which is still not good enough but budgets and targets are different things.
My budget is now gonna be sat around here which I think is way more representative. So I guess the takeaway here is don't believe everything you read especially on cswizardry.com. Okay. Starting to wrap up soon. This comes into some really interesting stuff that we chatted about earlier or that was spoken about earlier. What comes after before and after?
I mentioned this very briefly at the top of the talk. Before and after tests are highly error prone. They're fraught with problems. I mentioned to this, mentioned this during the break. You could spend all summer optimizing web performance for your website that sells hats and scarves and gloves and sit back in autumn and think that performance work was really effective because we're selling so many hats and scarves and gloves in November.
Before and after is highly error prone. Randomized and concurrent a b tests are probably, oh, do wanna get a picture of that? A randomized and concurrent a b test is gonna be as close to the gold standards that we can probably get. With a properly controlled, designed, randomized AB test, you could reasonably expect cohort a and cohort b would have the same amount of mobile users, same amount of desktop users as each other.
Not guaranteed but randomly assigned you could reasonably expect that they would have the same amount of each. Same amount of organic traffic versus paid traffic. Same amount of slow experiences. The only meaningful difference between these two cohorts should be control and treatment. Someone had the normal experience. Someone was given a treatment.
This is the value of AB test. This is why they're so much better than before and after. Because the problem with the before and after, like what could happen if we did a before and after test is, you remember the France, French, Africa problem? If we'd done a before and after around that, before we may have had a lot of highly motivated European visitors who were likely to make a purchase, more likely to make a purchase also happened to be on faster connections.
Then we have a completely different external influence that we haven't accounted for. Well all of a sudden we're sending loads of traffic or loads of ads, sorry, to African nations that are not likely to buy because we don't sell to them and they're all on slower connections. The summons, you'd surmise from this experiment that well it was a complete disaster. We tanked it.
This would've been solved by a concurrent AB test because yeah, we'd still have sent loads of ads to Africa but at least they'd have appeared in both cohorts. Before and after simply cannot control for stuff outside of your control I suppose. So a lot of the case studies we read, a lot of the case studies we write are based on before and afters. And it has been mentioned already that you try and control for as much as you can.
Filter out campaign traffic. Filter out paid search. Filter out known customers. Right? Returning customers are probably more likely to buy than new customers. Unless you're running a campaign where new customers get bigger discounts. You you, if you run these concurrently, you can control for all of it. If you run them before and after, you're susceptible to all of these external variants.
So fully randomized concurrent AB tests, uh-uh, the only real, well that's a very strong statement. But AB tests are the way. If you wanna test things properly, you need to be running AB tests. Which leads me onto faster is worse? We spent a lot of effort, spent a concerted effort making a webshop faster and conversions went down.
This next section, I know it's like the last few slides of a very long day but please bear with me because there's gonna be some mental math. You're gonna have to juggle a few numbers but I wanna illustrate this. I've tried to keep the numbers as simple as possible but I'm gonna try to illustrate this with numbers.
Imagine we've got a webshop, an ecommerce site, and one week it's normal and the next week it's faster. So we might say the old version, the slower version, had last week shoppers because it was live last week. And last week shoppers bought 84 items per every thousand visits. So we can say that last week the conversion rate was 8.4%.
This week in the faster version, we only sold 48 products per thousand visitors. So this week the faster version converted at 4.8%. Would you roll back the change? Based only on this you might do because like shit, that's definitely worse. But again we don't have enough data. This data, these numbers are entirely illustrative.
This is not real numbers. They're they're trying to make them palatable. Let's look at external influences. Something that could have affected this before and after. Let's make some assumptions. Let's say that returning visitors always convert at 10% and new visitors always convert at 2%. 10% of 800 is 80. 2% of 200 is four. That's where you get your 84 from.
We had 800 returning visitors who always convert at 10%. 200 new visitors that always convert at two. That's why we sold eight, 84 products. Let's say this week, someone ran an ad campaign and the the the demographic split reversed. All of a sudden we have 200 returning visitors and 800 new visitors. The good news is returning visitors convert two percentage points, in fact no. Two things are true, right?
They convert two percentage points faster. They also convert 20% better. Use the latter. 20% sounds way better than two percentage points. But let's say that the faster version, returning shoppers always convert at 12%, two percentage points better. And new shoppers always convert at 3%, 33% better. So the the speed has worked.
We sold more percentage wise but the absolutes have changed. 12% of 200 is still a smaller number than 10% of 800. So a better question to ask was how much would we have sold if we hadn't made the site faster? If we'd have the demographic split but we hadn't made the optimizations, we'd have only sold 36 per 1,000 visitors.
We'd have actually had a 36% conversion rate. Yeah, sorry. 3.6% conversion rate. A change in population masked otherwise valuable work. This could have been captured by a concurrent AB test. We've got a net gain of 12 sales per thousand visitors here because the faster version did convert better percentage wise which comparing against the wrong absolute. Oh, PPK's approaching.
Oh, slide a 167 of a 169. So we're we're all set. Far more than site speed is alone is responsible for conversions. Oh I forgot to mention It is so naive of us to think that site speed is the only thing that would influence conversions. The worst product in the world will not sell more units if you make its website faster.
We are a tiny part of the the solution to selling things, right? Site speed is a really small part of that and it'd be naive to think that by simply making a site faster, we're gonna sell more stuff. Having a Black Friday sale makes way more money than making the site faster, right? Things like that have way more influence immediately.
But sight speed helps which means a bit more humble and fit into that bigger picture. I just wanna say thank you very much for having me and yeah? Questions? Yeah. Amazing. No time for questions. Right. If anyone has any questions, you can come and catch me. Come and grab me but thank you all very much.
People
- Farid Zakaria
Technologies & Tools
- Content Delivery Network
- obs.js
- gzip
- Lighthouse
- Twitter SDK
- WebPageTest
- Lantern
Standards & Specs
- Brotli
- Zstandard
- srcset
- Media Queries
- Web Workers
- CSS
- ETag
- Event Timing API
Concepts & Methods
- Largest Contentful Paint
- Real User Monitoring
- Adaptive Loading
- Time to First Byte
- Synthetic Testing
- A/B Testing
- Cumulative Distribution Function
- Total Blocking Time
- Soft Navigation
- Interaction to Next Paint
- Bimodal Distribution
- First Input Delay
- Core Web Vitals
- Time to Interactive
- First Contentful Paint
- Spearman’s Rank Correlation
- Performance Budgets
Organisations & Products
- CSS Wizardry
- Chrome UX Report
- Pitchup
- SpeedCurve
- ANWB Routeplanner
- Google Chrome
- DebugBear













