Visually complete (%)
0
25
50
75
100
Time in Seconds
0s 1s 2s 3s 4s 5s 6s 7s 8s
Slide 20
Slide 20 text
Visually complete (%)
0
25
50
75
100
Time in Seconds
0s 1s 2s 3s 4s 5s 6s 7s 8s
Slide 21
Slide 21 text
Visually complete (%)
0
25
50
75
100
Time in Seconds
0s 1s 2s 3s 4s 5s 6s 7s 8s
Slide 22
Slide 22 text
Visually complete (%)
0
25
50
75
100
Time in Seconds
0s 1s 2s 3s 4s 5s 6s 7s 8s
Slide 23
Slide 23 text
Visually complete (%)
0
25
50
75
100
Time in Seconds
0s 1s 2s 3s 4s 5s 6s 7s 8s
Slide 24
Slide 24 text
Visually complete (%)
0
25
50
75
100
Time in Seconds
0s 1s 2s 3s 4s 5s 6s 7s 8s
Slide 25
Slide 25 text
So, how’s difference
calculated?
Slide 26
Slide 26 text
-
=
Slide 27
Slide 27 text
6% difference
Slide 28
Slide 28 text
5% difference
Slide 29
Slide 29 text
this is not good
for the user
this is
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
No content
Slide 32
Slide 32 text
Baseline JPEG
10%
Slide 33
Slide 33 text
Baseline JPEG
10% 50%
Slide 34
Slide 34 text
Baseline JPEG
10% 50% 100%
Slide 35
Slide 35 text
Gotcha!
Slide 36
Slide 36 text
Baseline JPEG
If the image loads gradually over 1 second,
it has a SpeedIndex of 500
Slide 37
Slide 37 text
Progressive JPEG
10% 50% 100%
Slide 38
Slide 38 text
Progressive JPEG
The image is already ~77% complete at the
beginning (it’s 23% different)
Slide 39
Slide 39 text
Progressive JPEG
So if it loads gradually over 1 second,
it has a SpeedIndex of 113
Slide 40
Slide 40 text
Some tricks …
Slide 41
Slide 41 text
Webfonts
Slide 42
Slide 42 text
Modern
browser?
Supports
WOFF?
Font in
Storage
Show
Font
Pre-Render
Slide 43
Slide 43 text
Modern
browser?
Supports
WOFF?
Font in
Storage
Show
Font
No Font
http://crocodillon.com/blog/non-blocking-web-fonts-using-localstorage
Pre-Render
Slide 44
Slide 44 text
localStorage
available?
Download
Font
Save in
localStorage
Show
Font
No Font
http://crocodillon.com/blog/non-blocking-web-fonts-using-localstorage
Post-Render
Slide 45
Slide 45 text
Critical Path CSS
Slide 46
Slide 46 text
No content
Slide 47
Slide 47 text
blocking!
Slide 48
Slide 48 text
blocking!
blocking!
Slide 49
Slide 49 text
blocking!
blocking!
start render
Slide 50
Slide 50 text
blocking!
blocking!
start render?
Slide 51
Slide 51 text
…
…
loadCSS(‘main.css’)
Slide 52
Slide 52 text
…
…
loadCSS(‘main.css’)
Slide 53
Slide 53 text
…
…
loadCSS(‘main.css’)
Slide 54
Slide 54 text
No content
Slide 55
Slide 55 text
No content
Slide 56
Slide 56 text
I’m not 100% happy with Critical Path CSS
Slide 57
Slide 57 text
No content
Slide 58
Slide 58 text
No content
Slide 59
Slide 59 text
No content
Slide 60
Slide 60 text
There is still one thing however…
Slide 61
Slide 61 text
Speed Index should give you an
idea how the user feels when
using your website
GetFirstPaint();
Calculate the timing when the browser
painted first.
Slide 78
Slide 78 text
// IE and Edge
window.performance.timing.msFirstPaint
// Chropera
var times = window.chrome.loadTimes();
times.firstPaintTime
Slide 79
Slide 79 text
// Every other browser
var headURLs = {};
var headElements =
doc.getElementsByTagName('head')[0].children;
for (var i = 0; i < headElements.length; i++) {
//get stylesheets and non-async scripts
...
}
// compare with resource timing
var requests =
win.performance.getEntriesByType("resource");
Slide 80
Slide 80 text
GetFontTime();
Check all font resources and do
resource timings …
Slide 81
Slide 81 text
CalculateSpeedIndex();
Given the visual progress information,
calculate the speed index.
Slide 82
Slide 82 text
resource1
firstPaint
resource3
resource4
endofPaint
responseStart
document
font
Slide 83
Slide 83 text
resource1
firstPaint
resource3
resource4
endofPaint
responseStart
blank, 1 point per ms! gradually
document
font
Slide 84
Slide 84 text
var now = ruxitApi.now();
var actionId =
ruxitApi.enterAction(
'Speed Index',
'speedIndex',
now - RUMSpeedIndex(),
null);
ruxitApi.leaveAction(actionId, now);
Tell your monitor solution