-
Notifications
You must be signed in to change notification settings - Fork 24
/
index.html
392 lines (347 loc) · 12.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Is my host fast yet?</title>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-22381566-4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-22381566-4');
</script>
<link href="https://fonts.googleapis.com/css?family=Chivo:900&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="style.css">
<style>
p, td {
font-weight: 400;
}
section {
margin-bottom: 30px;
}
small {
font-size: small;
}
dd {
margin-left: 20px;
}
td {
vertical-align: middle;
}
#results.loading {
color: #ddd;
}
#results.loading .fast {
background-color: hsla(153, 0%, 34%, 1);
color: hsla(153, 0%, 34%, 1);
}
#results.loading .avg {
background-color: hsl(44, 0%, 62%);
color: hsl(44, 0%, 62%);
}
#results.loading .slow {
background-color: hsl(4, 0%, 56%);
color: hsl(4, 0%, 56%);
}
.ttfb {
width: 60%;
text-align: right;
}
.ttfb span {
display: inline-block;
overflow: hidden;
line-height: 30px;
font-size: 0.8em;
font-weight: bold;
text-shadow: none;
color: #fff;
}
.fast {
background-color: #0aa55f;
}
.fast:hover {
outline: 1px solid #0aa55f;
}
.avg {
background-color: #fbca42;
}
.avg:hover {
outline: 1px solid #fbca42;
}
.slow {
background-color: #dd493f;
}
.slow:hover {
outline: 1px solid #dd493f;
}
@media only screen and (min-width: 768px) {
.inner {
width: 800px;
}
code {
white-space: nowrap;
}
}
@media ((-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi), (min-resolution: 1.5dppx)) {
p, td {
font-weight: 300;
}
}
</style>
<link rel="shortcut icon" href="https://ismyhostfastyet.com/favicon.svg">
<link rel="canonical" href="https://ismyhostfastyet.com/">
<meta name="author" content="Rick Viscomi">
<meta name="description" content="A study of web host performance using real-world transparency data from Chrome UX Report and HTTP Archive.">
<meta property="og:title" content="Is my host fast yet?">
<meta property="og:locale" content="en_US">
<meta property="og:url" content="https://ismyhostfastyet.com/">
<meta property="og:site_name" content="Is my host fast yet?">
<script type="application/ld+json">
{
"@type": "WebSite",
"url": "https://ismyhostfastyet.com/",
"name": "ismyhostfastyet",
"headline": "Is my host fast yet?",
"@context": "http://schema.org"
}
</script>
</head>
<body>
<div id="container">
<div class="inner">
<header>
<h1>Is my host fast yet?</h1>
<h2>Real-world server response (Time to First Byte) latencies, as experienced by real-world users navigating the web.</h2>
</header>
<hr>
<section>
<h2>Leaderboard: September 2024</h2>
<form id="filter">
<label>
Sort by
<select name="sort">
<option value="fast" selected>Fast</option>
<option value="avg">Average</option>
<option value="slow">Slow</option>
<option value="platform">Host</option>
<option value="client">Client</option>
<option value="n">Websites</option>
</select>
</label>
</form>
<table>
<thead>
<th>Host</th>
<th>Client</th>
<th>Websites</th>
<th>Fast<br>(p75 < 800ms)</th>
<th>Average</th>
<th>Slow<br>(p75 >= 1800ms)</th>
</thead>
<tbody id="results" class="loading"></tbody>
</table>
</section>
<section>
<p>
See a missing hosting provider?
<a href="https://github.com/rviscomi/ismyhostfastyet/blob/master/README.md#contribute">
Please help us identify how to surface them here.
</a>
</p>
</section>
<section>
<h2>How do you measure real-world Time to First Byte?</h2>
<p>
This report is powered by <a href="http://bit.ly/chrome-ux-report">Chrome User Experience Report</a>,
which provides user experience metrics for how real-world Chrome users experience popular
destinations on the web. As a result, this report does not rely on synthentic tests of
each hosting provider, but instead provides insight into how real-world users experience
the speed of sites hosted by various providers.
</p>
<h2>What is Time to First Byte?</h2>
<p>
<a href="https://web.dev/articles/ttfb">TTFB</ttfb> is measured as the time from the start of navigation request until the time that the
client receives the first byte of the response from the server. It includes network setup time
(SSL, DNS, TCP) as well as server-side processing.
</p>
<img src="ttfb.png" loading="lazy" height="320" width="800" alt="Diagram showing TTFB as the network events from the prompt for unload to the response start">
<p>
As you can see in the <a href="https://w3c.github.io/navigation-timing/">Navigation Timing Level 2 draft spec</a>
screenshot above, the metric is equivalent to <code>performance.getEntriesByType('navigation')[0].responseStart</code>
(or <code>firstInterimResponseStart</code> for those servers using 103 Early Hints).
</p>
<h2>How do you determine: Fast, Average, Slow?</h2>
<p>
The thresholds for fast/average/slow TTFB are 800 ms as the upper limit for fast TTFB and 1800 ms as the lower limit for slow TTFB.
</p>
<p>
The 75th percentile (p75) TTFB is analyzed for each website, which is determined to be fast or slow by where it falls between those thresholds.
</p>
<p>
The percentages for each host are calculated by taking the number of websites whose p75 TTFB is fast, average, and slow, and dividing each by the total number of websites.
</p>
<h2>How frequently is this reported updated?</h2>
<p>
Chrome UX Report publishes monthly datasets on the second Tuesday and this report is updated shortly after.
</p>
<h2>How are the hosting providers detected?</h2>
<p>
Chrome UX Report does not provide an explicit dimension for which hosting provider
is associated with each origin. To perform the classification we rely on another
dataset: <a href="https://httparchive.org">HTTP Archive</a> crawls all of the origins provided
in CrUX and runs logic to identify providers based on header signatures, DNS records, and other signals.
</p>
<p>
For example, a response header of <code>X-Powered-By: HubSpot</code> for a website's HTML page indicates that
it is hosted by HubSpot.
</p>
<p>
Would you like to see a hosting provider included in this report that’s currently
not on the list? Please <a href="https://github.com/rviscomi/ismyhostfastyet/blob/master/README.md#methodology">read more about our methodology</a>
and <a href="https://github.com/rviscomi/ismyhostfastyet/">join us on GitHub</a> — we’d appreciate your help to
allow us to expand coverage of this report!
</p>
<h2>What about <em>X</em>?</h2>
<p>Good question! Please <a href="https://github.com/rviscomi/ismyhostfastyet/issues">start a discussion</a> on GitHub, so we can answer it.</p>
</section>
<footer>
ismyhostfastyet is maintained by <a href="https://twitter.com/rick_viscomi">Rick Viscomi</a>
</footer>
</div>
</div>
<script>
function makeRow(host, client, n, fast, avg, slow) {
const tr = document.createElement('tr');
let td = document.createElement('td');
td.innerText = host;
tr.appendChild(td);
td = document.createElement('td');
td.innerText = client;
tr.appendChild(td);
td = document.createElement('td');
td.innerText = isNaN(parseInt(n, 10)) ? n : (+n).toLocaleString();
tr.appendChild(td);
td = document.createElement('td');
td.setAttribute('colspan', 3);
td.className = 'ttfb';
let span = document.createElement('span');
span.className = 'fast'
span.title = `Fast: ${formatPct(fast)} of websites`;
span.style.width = `${fast * 100}%`;
span.innerText = formatPct(fast);
td.appendChild(span);
span = document.createElement('span');
span.className = 'avg'
span.title = `Average: ${formatPct(avg)} of websites`;
span.style.width = `${avg * 100}%`;
span.innerText = formatPct(avg);
td.appendChild(span);
tr.appendChild(td);
span = document.createElement('span');
span.className = 'slow'
span.title = `Slow: ${formatPct(slow)} of websites`;
span.style.width = `${slow * 100}%`;
span.innerText = formatPct(slow);
td.appendChild(span);
return tr;
}
function formatPct(n) {
return (n * 100).toFixed(0) + '%';
}
function updateResultsTable(data) {
const results = document.getElementById('results');
// Clear any stale contents.
results.innerHTML = '';
const frag = document.createDocumentFragment();
data.forEach(i => {
const tr = makeRow(i.platform, i.client, i.n, i.fast, i.avg, i.slow);
frag.appendChild(tr);
});
results.appendChild(frag);
}
function sortResults(data, field) {
if (!(field in data[0])) return data;
return data.sort((a, b) => {
const diff = b[field] - a[field];
if (isNaN(diff)) {
// Do string comparison instead.
return a[field].localeCompare(b[field]);
}
return diff;
});
}
function getRandomFiller(maxLength) {
var filler = '█';
var len = Math.ceil(Math.random() * maxLength);
return new Array(len).fill(filler).join('');
}
function getRandomDistribution() {
var fast = Math.random();
var avg = (1 - fast) * Math.random();
var slow = 1 - (fast + avg);
return [fast, avg, slow];
}
function getSortField() {
const sortField = new URL(location.href).searchParams.get('sort');
const isValid = !!document.querySelector(`#filter option[value="${sortField}"]`);
if (!isValid) {
return 'fast';
}
return sortField;
}
function updateUrlField(key, value) {
const url = new URL(location);
url.searchParams.set(key, value);
history.replaceState({}, '', url);
}
function setPlaceholderData() {
// Temporary placeholder data.
const NUM_ROWS = 46;
window.data = [];
for (var i = 0; i < NUM_ROWS; i++) {
var [fast, avg, slow] = getRandomDistribution();
window.data.push({
platform: getRandomFiller(10),
client: getRandomFiller(5),
n: getRandomFiller(1),
fast,
avg,
slow
});
}
}
function setDefaultSort(sortField) {
document.querySelector('#filter select').value = sortField;
}
function initSortHandler() {
document.getElementById('filter').addEventListener('change', (e) => {
const field = e.target.value;
gtag('event', 'sort', {'event_category': 'engagement', 'event_label': field});
updateResultsTable(sortResults(window.data, field));
updateUrlField('sort', field);
});
}
function fetchData(sortField) {
fetch('ttfb.json').then(r => r.json()).then(r => {
window.data = r;
const results = document.getElementById('results');
results.classList.remove('loading');
updateResultsTable(sortResults(r, sortField));
});
}
function init() {
const sortField = getSortField();
setDefaultSort(sortField);
initSortHandler();
// Display the placeholder data.
setPlaceholderData();
updateResultsTable(sortResults(window.data, sortField));
fetchData(sortField);
}
init();
</script>
<script type="module" src="vitals.js"></script>
</body>
</html>