SlideShare a Scribd company logo
1 of 144
Download to read offline
Performance

as User Experience
Aaron Gustafson
@AaronGustafson
slideshare.net/AaronGustafson
/dəˈzīn/
JEFF VEEN
“I’ve been amazed at how often those
outside the discipline of design assume
that what designers do is decoration—
likely because so much bad design

simply is decoration. Good design isn’t.

Good design is problem solving.”
/ˈfrikSH(ə)n/
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Hallmarks of Good UX
๏ Streamlined flow
๏ Clear, concise copy
๏ Low cognitive load
๏ Fast performance
5
Poor performance

is friction
Source: eMarketer
A 1s delay in page

load can reduce

conversions by 7%
Source: Kissmetrics
For an online shop earning
$100k/day, that’s about
$2.5m in lost sales
Source: Kissmetrics
For Amazon, 1s is worth

about $1.6b in sales
Source: HubSpot
Source: eMarketer
53% abandon

websites that take

more than 3s to load
Source: Google
By shaving 7s off load,
Edmunds increased

page views by 17%

& ad revenue by 3%
Source: HubSpot
Mozilla reduced page load
by 2.2s and saw a 15.4%
increase in downloads
Source: HubSpot
Performance

matters
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
What we were looking for
๏ Usable pages are delivered in 10kB or less
๏ Pages are accessible via screen readers, the keyboard, etc.
๏ Entries follow the philosophy of progressive enhancement
๏ Users can do what they need to without JavaScript
18
/dôɡˈfo͞odiNG/
Let’s talk (briefly)

about page load
time
Your Device The Web
Where can I find a-k-apart.com?
It’s at 40.77.56.174
DNS Lookup
 Icons by Mahmure Alp
time
Your Device The Web
Where can I find a-k-apart.com?
It’s at 40.77.56.174
TCP Handshake
Hello 40.77.56.174
Howdy!
 Icons by Mahmure Alp
time
Your Device The Web
Where can I find a-k-apart.com?
It’s at 40.77.56.174
Request
Hello 40.77.56.174
Howdy!
I’d like /index.html
 Icons by Mahmure Alp
time
Your Device The Web
Where can I find a-k-apart.com?
It’s at 40.77.56.174
Server Processing
Hello 40.77.56.174
Howdy!
I’d like /index.html
 Icons by Mahmure Alp
time
Your Device The Web
Where can I find a-k-apart.com?
It’s at 40.77.56.174
Response
Hello 40.77.56.174
Howdy!
I’d like /index.html
Ok, here it is.
 Icons by Mahmure Alp
 Icons by Mahmure Alp
 Icons by Mahmure Alp
Response
Load
Paint
Layout
RenderTree
CSS
DOM
 Icons by Mahmure Alp
Response
Load
Paint
Layout
RenderTree
CSS
DOM
CSS & JavaScript can
delay rendering or cause
these to be run again
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>	
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>		
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>		
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>		
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>	
wait while the browser

fetches & parses the script
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>		
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>	
wait while the browser

fetches & parses the CSS
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>	
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>		
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>		
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>	
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>	
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>	
kicks off downloading

the image
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>		
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>	 wait while the browser

fetches & parses the script
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>		
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
DOM Parsing
<html>	
	<head>	
		<title>Silly	example</title>		
		<script	src="head.js"></script>	
		<link	rel="stylesheet"	href="main.css">	
		<style>h2	{	font-weight:	bold;	}</style>	
		<script>console.log('hi');</script>	
	</head>	
	<body>	
				<img	src="my.png"	alt="">	
				<script	src="body.js"></script>	
	</body>	
</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Steps for better performance
1. Use native features whenever possible
2. Only include assets you actually need
3. Optimize everything
4. Think about when you load assets
5. Consider how you load assets
6. Only load assets when they add value
43
Step 1:

Use native features

whenever possible
(they’re effectively free)
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Por exemplo
<header>	
		Header	content…	
</header> not only shorter than

<div id=“header">, but

semantic too
depending on its location
in the document, could also
provide a landmark
for navigation
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Por exemplo
<input	id="n"	name="n"	
							required	aria-required="true"			
							autocorrect="off"

							autocapitalize="words"			
							placeholder="Sir	Tim	Berners	Lee"	
							autocomplete="name"	
							>
modern browsers require

users to enter content
browser can inform

assistive tech that

the field is required
don’t let the browser
try to correct
someone’s name
auto-disappearing suggestion
without JavaScript
if the browser already

knows the user’s name,

by all means, let it fill it in
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Por exemplo
<input	type="email"

							id="e"	name="e"

							required	aria-required="true"

							autocorrect="off"

							autocapitalize="off"

							autocomplete="email"

							placeholder="you@yourdomain.tld"

							>
modern browsers validate

the email address

and may supply a

custom keyboard layout
let the browser suggest

an email address if it has one
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Por exemplo
@media	(min-width:600px)	{

		.gridded	{	
				display:	grid;	
				grid-template-columns:	1fr	300px;	
				grid-gap:	20px;	
		}

}	
So much better than floats
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Por exemplo
var	$radios	=	document.querySelectorAll(	
																'input[type=radio]'	
														);
CSS selector-based

DOM traversal

without a JS library
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Por exemplo
font-family:	Georgia,	Times,

													"Times	New	Roman",	serif
font-family:	"Segoe	UI",	Frutiger,

													"Frutiger	Linotype",

													"Dejavu	Sans",	"Helvetica	Neue",

													Arial,	sans-serif;
Serif
Sans Serif
If you need

a custom font:

subset, subset, subset
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Proceed with caution
Source: Bran Stein
Step 2:

Only include assets

you actually need
Great tools,
possibly overkill
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Every tool has a cost
Framework Size (Compressed)
Bootstrap 2 149 kB
Bootstrap 3 103 kB
Angular 1.4 51 kB
Ember 2.2.0 111 kB
Foundation 4 266 kB
jQuery 32 kB
UI Kit 86 kB
React 16 + React DOM 35 kB
Vue 2.4.2 20 kB
Chances are, your

library of choice

is on a CDN
time
Your Device The Web
Where can I find cdn.foo.com?
It’s at 123.45.67.89
 Icons by Mahmure Alp
You can optimize this
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Find the server early
<link	rel="dns-prefetch"

						href="https://cdn.foo.com">
Drop this in the

head of your pages
time
Your Device The Web
Where can I find cdn.foo.com?
It’s at 123.45.67.89
Hello 123.45.67.89
Howdy!
 Icons by Mahmure Alp
You can optimize this
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Go for the handshake
<link	rel="preconnect"

						href="https://cdn.foo.com">
time
Your Device The Web
I’d like /jquery.min.js
Ok, here it is.
 Icons by Mahmure Alp
You can even optimize this
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Grab that resource
<link	rel="preload"

						href="https://cdn.foo.com/jquery.min.js"

						as="script">
Helps optimize the process
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Download isn’t everything
Source: The Filament Group
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Download isn’t everything
Framework Method/function operations/s
Vanilla JS document.getElementById() 12,137,211
Dojo dojo.byId(); 5,443,343
Prototype $() 2,940,734
Ext JS Ext.get() 997,562
jQuery $() 350,557
YUI YAHOO.util.Dom.get() 326,534
MooTools document.id() 78,802
Source: VanillaJS
100% library free
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
We used some hints though
<link	rel="preconnect"

						href="//10kapart.blob.core.windows.net">	
<link	rel="preconnect"

						href="//cdnjs.cloudflare.com">	
<link	rel="preconnect"

						href="//www.google-analytics.com">
Step 3:

Optimize
everything
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Our approach to CSS (Gulp)
1. Write modular CSS in Sass (+ Breakup for MQ management)
2. Compile CSS with a precision of 4 decimal places (gulp-sass)
3. Fallbacks for the last 2 browser versions (gulp-autoprefixer)
4. CSS shorthand declarations if possible (gulp-shorthand)
5. Remove any unused declarations/rule sets (gulp-uncss)
6. Optimize the files (gulp-csso)
7. Minify (gulp-clean-css)
8. Gzip (gulp-zopfli)
9. Brotli (gulp-brotli)
71
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Before
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
After
everyone else

8 kB
browsers that support

brotli compression

2 kB
browsers that support
gzip compression
3 kB
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Our approach to JS (Gulp)
1. Write modular JavaScript, grouped as appropriate
2. Combine files based on folder structure (gulp-folders, gulp-concat)
3. Create an wrapping closure to isolate from other JS (gulp-insert)
4. Minify (gulp-uglify)
5. Gzip (gulp-zopfli)
6. Brotli (gulp-brotli)
74
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Results
about 8 kB all-up
4 kB
1 kB
2 kB
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Interesting side note
indexes last
indexes first
We also minified

& pre-compressed

our HTML
Step 4:

Think about when

you load assets
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
We had 10 JS files
๏ Global
‣ main.js - the site’s library
‣ serviceworker.js - The site’s service worker
๏ Browser-specific
‣ html5shiv.js - local copy of the HTML5 Shiv for < IE9
79
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
We had 10 JS files
๏ Page-specific
‣ enter.js - Entry form-related code
‣ form-saver.js - Used to save form entries locally until submitted
‣ hero.js - Runs the SVG animation on the homepage
‣ home.js - Handles homepage-specific tasks
‣ project.js - Used on project pages during voting
‣ update.js - Handles the winner update form
80
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Per the common wisdom
				<script	src="/j/main.min.js"></script>

		</body>

</html>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
No need to run immediately
				<script	src="/j/main.min.js"></script>

				<script	src="/j/home.min.js"

												defer

												></script>

		</body>

</html>
run after the DOM is loaded
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Run whenever you can
				<script	src="/j/main.min.js"></script>

				<script	src="/j/home.min.js"

												async

												></script>

		</body>

</html>
run whenever it becomes

available, but don’t

delay page load
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Consider dependencies
<script	src="/j/main.min.js"	async></script>

<script	src="/j/home.min.js"	async></script>
what if this calls a function

in main.min.js?
“race condition”
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Avoid race conditions
<script	src="/j/main.min.js"></script>

<script	src="/j/home.min.js"	async></script>
Why so many

separate files?
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Connections in HTTP/1.1
Browser Per host Overall
IE 9 6 35
IE 10 8 17
IE 11 13 17
Firefox 4+ 6 17
Opera 11+ 6 user defined
Chrome 4+ 6 10
Safari 7+ 6 17
time
Your Device The Web
HTTP/1.1
 Icons by Mahmure Alp
I’d like /c/main.css
I’d like /j/main.min.js
I’d like /i/o.svg
I’d like /j/home.min.js
I’d like /i/edge.svg
I’d like /i/aea.svg
HTTP/2 creates

a single connection and
contents stream in
time
Your Device The Web
HTTP/2
 Icons by Mahmure Alp
I’d like /c/main.css
I’d like /i/o.svg
I’d like /i/edge.svg
Source: A List Apart
Demo: Akamai
Source: A List Apart
Step 5:

Consider how

you load assets
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Start simple
<link	rel="stylesheet"	href="/c/d.min.css">		
<link	rel="stylesheet"	href="/c/a.min.css"

						media="only	screen">		
default styles
(all browsers)
advanced styles

(modern browsers)
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Fault tolerance FTW!
<link	rel="stylesheet"	href="/c/d.min.css">		
<link	rel="stylesheet"	href="/c/a.min.css"

						media="only	screen">		
browsers that don’t grok

media queries ignore this file
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Conditional scripting
<!--[if	lt	IE	9]>		
		<script	src="/j/html5shiv.min.js"></script>		
<![endif]-->	
delivers this script

to <= IE 8
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Conditional scripting
				<!--[if	gt	IE	8]><!-->

						<script	src="/j/main.min.js"></script>

						<script	src="/j/home.min.js"	async

														></script>

				<!--<![endif]-->

		</body>

</html>
hides scripts from <= IE8
(no need to test!)
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Conditional imagery
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Conditional images
@media	(min-width:	36.375em)	{	
		.presented-by	[href*=microsoft]::before	{	
				background-image:	url(/i/c/edge.png);	
				background-image:	url(/i/c/edge.svg),

																						none;

				…	
		}	
}
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Conditional images
@media	(min-width:	36.375em)	{	
		.presented-by	[href*=microsoft]::before	{	
				background-image:	url(/i/c/edge.png);	
				background-image:	url(/i/c/edge.svg),

																						none;

				…	
		}	
}
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Conditional images
@media	(min-width:	36.375em)	{	
		.presented-by	[href*=microsoft]::before	{	
				background-image:	url(/i/c/edge.png);	
				background-image:	url(/i/c/edge.svg),

																						none;

				…	
		}	
}
browsers that support
multiple backgrounds
also support SVG
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Conditional animation
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
How do we get there?
JS?
No
No imageLoad
Yes
<>
SVG support?
Yes
SVG
Ajax request SVG

Yank out script & add to document
No
picture
Save the markup for

next page load
NoYes
Verify browser
width condition
Step 6:

Only load assets
when they add value
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Evaluate images case-by-case
๏ Does the image reiterate information found in the surrounding text?
๏ Is the image necessary to understand the surrounding content?
๏ Does the image contain text?
๏ Is the image a graph, chart, or table?
๏ Could the content of the image be presented in a different format
that would not require an image?
๏ Is the image purely presentational?
111
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
53% of the average web page
Source: Internet Archive
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
And they don’t always fit
Source: The Outline
If you can avoid

using an image, do it
If you need an image,
choose the best format
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Quick format recap
๏ GIF
‣ for images with large swaths of solid colors
‣ Binary transparency
๏ JPG
‣ For photographs and images with gradations of color
‣ Can be compressed (introduces artifacts)
117
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Quick format recap
๏ PNG (8-Bit)
‣ Alternative to GIF
‣ Can support alpha transparency (with the right creation software)
๏ PNG (24-bit)
‣ Alternative to JPG
‣ Usually larger than JPGs
‣ Supports alpha tranparency
118
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Quick format recap
๏ WebP
‣ Newer format, not universally supported
‣ Smaller than JPGs and 24-bit PNGs
‣ Support alpha transparency
‣ and so much more…
119
Sometimes images

are “nice to have”
that’s 29 kB of images
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
How it works
<li	class="gallery__item	h-card"

				data-img="/i/j/r.jpg||y"

				>	
		<a	href="https://twitter.com/rachelandrew">

				<b>Rachel	Andrew</b>

		</a>	
</li>
image path
no alt necessary
prepend to

this list item
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Getting CSS & JS in sync
var	$watcher	=	document.createElement('div'),	
				re	=	/['"]/g;	
$watcher.setAttribute(	'id',	'getActiveMQ-watcher'	);	
$watcher.style.display	=	'none';	
document.body.appendChild(	$watcher	);	
window.getActiveMQ	=	function()	{	
		return	window.getComputedStyle(	$watcher,	null	)	
															.getPropertyValue(	'font-family'	)	
															.replace(	re,	''	);	
};
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Getting CSS & JS in sync
#getActiveMQ-watcher	{	font-family:	global;	}	
@media	(min-width:	15em)	{	
		#getActiveMQ-watcher	{	font-family:	tiny;	}	
}	
@media	(min-width:	20em)	{	
		#getActiveMQ-watcher	{	font-family:	small;	}	
}	
@media	(min-width:	30em)	{	
		#getActiveMQ-watcher	{	font-family:	medium;	}	
}	
@media	(min-width:	40em)	{	
		#getActiveMQ-watcher	{	font-family:	large;	}	
}	
@media	(min-width:	48.75em)	{	
		#getActiveMQ-watcher	{	font-family:	larger;	}	
}	
@media	(min-width:	60em)	{	
		#getActiveMQ-watcher	{	font-family:	full;	}	
}
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Getting CSS & JS in sync
var	$watcher	=	document.createElement('div'),	
				re	=	/['"]/g;	
$watcher.setAttribute(	'id',	'getActiveMQ-watcher'	);	
$watcher.style.display	=	'none';	
document.body.appendChild(	$watcher	);	
window.getActiveMQ	=	function()	{	
		return	window.getComputedStyle(	$watcher,	null	)	
															.getPropertyValue(	'font-family'	)	
															.replace(	re,	''	);	
};
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Getting CSS & JS in sync
var	MQ	=	getActiveMQ();	
if	(	MQ	==	'larger'	||	MQ	==	'full'	)	{	
		lazyLoadImages();	
}
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
How it works
<li	class="gallery__item	h-card"

				data-img="/i/j/r.jpg||y"

				>	
		<a	href="https://twitter.com/rachelandrew">

				<b>Rachel	Andrew</b>

		</a>	
</li>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Result!
<li	class="gallery__item	h-card"

				data-img="/i/j/r.jpg||y"

				data-imaged="true"

				>

		<img	src="/i/j/r.jpg"	alt="">

		<a	href="https://twitter.com/rachelandrew">

				<b>Rachel	Andrew</b>

		</a>	
</li>
Oh wait…
optimize everything
Source: 38 kB JPG
B&W: 35 kB JPG (-7%)
Crop & Resize: 12 kB JPG (-68%)
Blur & optimize: 9 kB JPG (-76%)
blurred everything

but their faces
WebP: 4 kB (-89%)JPG: 9 kB (-76%)
!

Not every browser

supports WebP
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Indicating alternate formats
<picture>	
		<source	type="image/webp"	srcset="my.webp">

		<img	src="my.jpg"	alt="Alt	text	goes	here">	
</picture>
first choice if
WebP is supported fallback image

if it isn’t
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Indicating alternate formats
<picture>	
		<source	type="image/svg+xml"

										srcset="my.svg">	
		<source	type="image/webp"	srcset="my.webp">

		<img	src="my.jpg"	alt="Alt	text	goes	here">	
</picture>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Indicating alternate formats
<li	class="gallery__item	h-card"

				data-img="/i/j/r.jpg||y"

				data-imaged="true"

				>

		<img	src="/i/j/r.jpg"	alt="">

		<a	href="https://twitter.com/rachelandrew">

				<b>Rachel	Andrew</b>

		</a>	
</li>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Indicating alternate formats
<li	class="gallery__item	h-card"

				data-img="/i/j/r.jpg||y"

				data-imaged="true"

				>

		<picture>

				<source	type="image/webp"

												srcset="/i/j/r.webp">

				<img	src="/i/j/r.jpg"	alt="">

		</picture>	
		<a	href="https://twitter.com/rachelandrew">

				<b>Rachel	Andrew</b>

		</a>	
</li>
PERFORMANCE AS USER EXPERIENCE @AaronGustafson
Steps for better performance
1. Use native features whenever possible
2. Only include assets you actually need
3. Optimize everything
4. Think about when you load assets
5. Consider how you load assets
6. Only load assets when they add value
146
Every choice we

make affects our

users’ experiences
Let’s spend our time to

save it for our users
Speedy performance is

a great user experience
Thank you!
@AaronGustafson
aaron-gustafson.com	
slideshare.net/AaronGustafson

More Related Content

What's hot

Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioChristian Heilmann
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster WebsitesCraig Walker
 
20 Tips to Improving WordPress Website - for Beginners-Aus-2017
20 Tips to Improving WordPress Website - for Beginners-Aus-201720 Tips to Improving WordPress Website - for Beginners-Aus-2017
20 Tips to Improving WordPress Website - for Beginners-Aus-2017TRB Design, Inc.
 
Progressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesProgressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesDigitally
 
The Users are Restless
The Users are RestlessThe Users are Restless
The Users are RestlessTerry Ryan
 
Implementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using CucumberImplementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using CucumberTechWell
 
Semantic HTML5
Semantic HTML5Semantic HTML5
Semantic HTML5Terry Ryan
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupJonathan Klein
 
UTEP AITP Presentation - 10/17/2012
UTEP AITP Presentation - 10/17/2012UTEP AITP Presentation - 10/17/2012
UTEP AITP Presentation - 10/17/2012impulsedev
 
WordPress Performance 101
WordPress Performance 101WordPress Performance 101
WordPress Performance 101Bora Yalcin
 
Wrangling the WordPress Template Hierarchy Like a Boss
Wrangling the WordPress Template Hierarchy Like a BossWrangling the WordPress Template Hierarchy Like a Boss
Wrangling the WordPress Template Hierarchy Like a BossIntrepidRealist
 
Hyperlight Websites - Chris Zacharias
Hyperlight Websites - Chris ZachariasHyperlight Websites - Chris Zacharias
Hyperlight Websites - Chris ZachariasChristopher Zacharias
 
High Performance Web - Full Stack Toronto
High Performance Web - Full Stack TorontoHigh Performance Web - Full Stack Toronto
High Performance Web - Full Stack TorontoMaximiliano Firtman
 
All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...Caelum
 

What's hot (20)

Multimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audioMultimedia on the web - HTML5 video and audio
Multimedia on the web - HTML5 video and audio
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster Websites
 
20 Tips to Improving WordPress Website - for Beginners-Aus-2017
20 Tips to Improving WordPress Website - for Beginners-Aus-201720 Tips to Improving WordPress Website - for Beginners-Aus-2017
20 Tips to Improving WordPress Website - for Beginners-Aus-2017
 
Seo training
Seo trainingSeo training
Seo training
 
Fully Optimized
Fully OptimizedFully Optimized
Fully Optimized
 
Progressively Enhancing WordPress Themes
Progressively Enhancing WordPress ThemesProgressively Enhancing WordPress Themes
Progressively Enhancing WordPress Themes
 
The Users are Restless
The Users are RestlessThe Users are Restless
The Users are Restless
 
Implementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using CucumberImplementing Testing for Behavior-Driven Development Using Cucumber
Implementing Testing for Behavior-Driven Development Using Cucumber
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
Optimizing wp
Optimizing wpOptimizing wp
Optimizing wp
 
Semantic HTML5
Semantic HTML5Semantic HTML5
Semantic HTML5
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
 
UTEP AITP Presentation - 10/17/2012
UTEP AITP Presentation - 10/17/2012UTEP AITP Presentation - 10/17/2012
UTEP AITP Presentation - 10/17/2012
 
WordPress Performance 101
WordPress Performance 101WordPress Performance 101
WordPress Performance 101
 
Wrangling the WordPress Template Hierarchy Like a Boss
Wrangling the WordPress Template Hierarchy Like a BossWrangling the WordPress Template Hierarchy Like a Boss
Wrangling the WordPress Template Hierarchy Like a Boss
 
Hyperlight Websites - Chris Zacharias
Hyperlight Websites - Chris ZachariasHyperlight Websites - Chris Zacharias
Hyperlight Websites - Chris Zacharias
 
High Performance Web - Full Stack Toronto
High Performance Web - Full Stack TorontoHigh Performance Web - Full Stack Toronto
High Performance Web - Full Stack Toronto
 
All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...
 
[In Control 2010] HTML5
[In Control 2010] HTML5[In Control 2010] HTML5
[In Control 2010] HTML5
 
Css web gallery
Css web galleryCss web gallery
Css web gallery
 

Similar to Performance as User Experience [AEADC 2018]

Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Aaron Gustafson
 
YGLF 2015 - Boom Performance | Eran Zinman (daPulse)
YGLF 2015 -  Boom Performance | Eran Zinman (daPulse)YGLF 2015 -  Boom Performance | Eran Zinman (daPulse)
YGLF 2015 - Boom Performance | Eran Zinman (daPulse)Eran Zinman
 
BOOM Performance
BOOM PerformanceBOOM Performance
BOOM Performancedapulse
 
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 201210 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 2012Bastian Grimm
 
Frontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser renderingFrontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser renderingManuel Garcia
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ XeroCraig Walker
 
Responsive content
Responsive contentResponsive content
Responsive contenthonzie
 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...John McCaffrey
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuningJohn McCaffrey
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moondavejohnson
 
Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019Katie Sylor-Miller
 
So…What Do I Make? (Dan Mall)
So…What Do I Make? (Dan Mall)So…What Do I Make? (Dan Mall)
So…What Do I Make? (Dan Mall)Future Insights
 
Happy Browser, Happy User! - PerfMatters Conference 2019
Happy Browser, Happy User! - PerfMatters Conference 2019Happy Browser, Happy User! - PerfMatters Conference 2019
Happy Browser, Happy User! - PerfMatters Conference 2019Katie Sylor-Miller
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX DesignersAshlimarie
 
The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013Bastian Grimm
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3Felipe Lavín
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukgareth53
 
implement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflowimplement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflowWordPress
 

Similar to Performance as User Experience [AEADC 2018] (20)

Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]
 
YGLF 2015 - Boom Performance | Eran Zinman (daPulse)
YGLF 2015 -  Boom Performance | Eran Zinman (daPulse)YGLF 2015 -  Boom Performance | Eran Zinman (daPulse)
YGLF 2015 - Boom Performance | Eran Zinman (daPulse)
 
BOOM Performance
BOOM PerformanceBOOM Performance
BOOM Performance
 
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 201210 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
 
Frontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser renderingFrontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser rendering
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
 
Please dont touch-3.6-jsday
Please dont touch-3.6-jsdayPlease dont touch-3.6-jsday
Please dont touch-3.6-jsday
 
Responsive content
Responsive contentResponsive content
Responsive content
 
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuning
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 
Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019
 
So…What Do I Make? (Dan Mall)
So…What Do I Make? (Dan Mall)So…What Do I Make? (Dan Mall)
So…What Do I Make? (Dan Mall)
 
Speed!
Speed!Speed!
Speed!
 
Happy Browser, Happy User! - PerfMatters Conference 2019
Happy Browser, Happy User! - PerfMatters Conference 2019Happy Browser, Happy User! - PerfMatters Conference 2019
Happy Browser, Happy User! - PerfMatters Conference 2019
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.uk
 
implement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflowimplement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflow
 

More from Aaron Gustafson

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Aaron Gustafson
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Aaron Gustafson
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Aaron Gustafson
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Aaron Gustafson
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Aaron Gustafson
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Aaron Gustafson
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Aaron Gustafson
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Aaron Gustafson
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]Aaron Gustafson
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Aaron Gustafson
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Aaron Gustafson
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for EveryoneAaron Gustafson
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Aaron Gustafson
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Aaron Gustafson
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Aaron Gustafson
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Aaron Gustafson
 
Progressive Web Apps and the Windows Ecosystem [Build 2017]
Progressive Web Apps and the Windows Ecosystem [Build 2017]Progressive Web Apps and the Windows Ecosystem [Build 2017]
Progressive Web Apps and the Windows Ecosystem [Build 2017]Aaron Gustafson
 
Writing for Engagement [TechReady 22]
Writing for Engagement [TechReady 22]Writing for Engagement [TechReady 22]
Writing for Engagement [TechReady 22]Aaron Gustafson
 
Designing the Conversation [SmashingConf 2016]
Designing the Conversation [SmashingConf 2016]Designing the Conversation [SmashingConf 2016]
Designing the Conversation [SmashingConf 2016]Aaron Gustafson
 
The Features of Highly Effective Forms [SmashingConf NYC 2016]
The Features of Highly Effective Forms [SmashingConf NYC 2016]The Features of Highly Effective Forms [SmashingConf NYC 2016]
The Features of Highly Effective Forms [SmashingConf NYC 2016]Aaron Gustafson
 

More from Aaron Gustafson (20)

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for Everyone
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]
 
Progressive Web Apps and the Windows Ecosystem [Build 2017]
Progressive Web Apps and the Windows Ecosystem [Build 2017]Progressive Web Apps and the Windows Ecosystem [Build 2017]
Progressive Web Apps and the Windows Ecosystem [Build 2017]
 
Writing for Engagement [TechReady 22]
Writing for Engagement [TechReady 22]Writing for Engagement [TechReady 22]
Writing for Engagement [TechReady 22]
 
Designing the Conversation [SmashingConf 2016]
Designing the Conversation [SmashingConf 2016]Designing the Conversation [SmashingConf 2016]
Designing the Conversation [SmashingConf 2016]
 
The Features of Highly Effective Forms [SmashingConf NYC 2016]
The Features of Highly Effective Forms [SmashingConf NYC 2016]The Features of Highly Effective Forms [SmashingConf NYC 2016]
The Features of Highly Effective Forms [SmashingConf NYC 2016]
 

Recently uploaded

Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full NightCall Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full Nightssuser7cb4ff
 
韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作7tz4rjpd
 
Passbook project document_april_21__.pdf
Passbook project document_april_21__.pdfPassbook project document_april_21__.pdf
Passbook project document_april_21__.pdfvaibhavkanaujia
 
Untitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptxUntitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptxmapanig881
 
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一Fi sss
 
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一Fi L
 
Design principles on typography in design
Design principles on typography in designDesign principles on typography in design
Design principles on typography in designnooreen17
 
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证nhjeo1gg
 
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改yuu sss
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...Rishabh Aryan
 
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一diploma 1
 
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一z xss
 
办理澳大利亚国立大学毕业证ANU毕业证留信学历认证
办理澳大利亚国立大学毕业证ANU毕业证留信学历认证办理澳大利亚国立大学毕业证ANU毕业证留信学历认证
办理澳大利亚国立大学毕业证ANU毕业证留信学历认证jdkhjh
 
Iconic Global Solution - web design, Digital Marketing services
Iconic Global Solution - web design, Digital Marketing servicesIconic Global Solution - web design, Digital Marketing services
Iconic Global Solution - web design, Digital Marketing servicesIconic global solution
 
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...katerynaivanenko1
 
group_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfgroup_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfneelspinoy
 
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...ttt fff
 
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts ServiceCall Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Servicejennyeacort
 

Recently uploaded (20)

Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full NightCall Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
 
韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作
 
Passbook project document_april_21__.pdf
Passbook project document_april_21__.pdfPassbook project document_april_21__.pdf
Passbook project document_april_21__.pdf
 
Untitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptxUntitled presedddddddddddddddddntation (1).pptx
Untitled presedddddddddddddddddntation (1).pptx
 
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
(办理学位证)埃迪斯科文大学毕业证成绩单原版一比一
 
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
办理学位证(TheAuckland证书)新西兰奥克兰大学毕业证成绩单原版一比一
 
Design principles on typography in design
Design principles on typography in designDesign principles on typography in design
Design principles on typography in design
 
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
 
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
 
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
DAKSHIN BIHAR GRAMIN BANK: REDEFINING THE DIGITAL BANKING EXPERIENCE WITH A U...
 
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
办理(麻省罗威尔毕业证书)美国麻省大学罗威尔校区毕业证成绩单原版一比一
 
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
 
办理澳大利亚国立大学毕业证ANU毕业证留信学历认证
办理澳大利亚国立大学毕业证ANU毕业证留信学历认证办理澳大利亚国立大学毕业证ANU毕业证留信学历认证
办理澳大利亚国立大学毕业证ANU毕业证留信学历认证
 
Iconic Global Solution - web design, Digital Marketing services
Iconic Global Solution - web design, Digital Marketing servicesIconic Global Solution - web design, Digital Marketing services
Iconic Global Solution - web design, Digital Marketing services
 
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
MT. Marseille an Archipelago. Strategies for Integrating Residential Communit...
 
group_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfgroup_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdf
 
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
昆士兰大学毕业证(UQ毕业证)#文凭成绩单#真实留信学历认证永久存档
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学欧克莱尔分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#...
 
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts ServiceCall Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
 

Performance as User Experience [AEADC 2018]

  • 1. Performance
 as User Experience Aaron Gustafson @AaronGustafson slideshare.net/AaronGustafson
  • 3. JEFF VEEN “I’ve been amazed at how often those outside the discipline of design assume that what designers do is decoration— likely because so much bad design
 simply is decoration. Good design isn’t.
 Good design is problem solving.”
  • 5. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Hallmarks of Good UX ๏ Streamlined flow ๏ Clear, concise copy ๏ Low cognitive load ๏ Fast performance 5
  • 6.
  • 9. A 1s delay in page
 load can reduce
 conversions by 7% Source: Kissmetrics
  • 10. For an online shop earning $100k/day, that’s about $2.5m in lost sales Source: Kissmetrics
  • 11. For Amazon, 1s is worth
 about $1.6b in sales Source: HubSpot
  • 13. 53% abandon
 websites that take
 more than 3s to load Source: Google
  • 14. By shaving 7s off load, Edmunds increased
 page views by 17%
 & ad revenue by 3% Source: HubSpot
  • 15. Mozilla reduced page load by 2.2s and saw a 15.4% increase in downloads Source: HubSpot
  • 17.
  • 18. PERFORMANCE AS USER EXPERIENCE @AaronGustafson What we were looking for ๏ Usable pages are delivered in 10kB or less ๏ Pages are accessible via screen readers, the keyboard, etc. ๏ Entries follow the philosophy of progressive enhancement ๏ Users can do what they need to without JavaScript 18
  • 21. time Your Device The Web Where can I find a-k-apart.com? It’s at 40.77.56.174 DNS Lookup  Icons by Mahmure Alp
  • 22. time Your Device The Web Where can I find a-k-apart.com? It’s at 40.77.56.174 TCP Handshake Hello 40.77.56.174 Howdy!  Icons by Mahmure Alp
  • 23. time Your Device The Web Where can I find a-k-apart.com? It’s at 40.77.56.174 Request Hello 40.77.56.174 Howdy! I’d like /index.html  Icons by Mahmure Alp
  • 24. time Your Device The Web Where can I find a-k-apart.com? It’s at 40.77.56.174 Server Processing Hello 40.77.56.174 Howdy! I’d like /index.html  Icons by Mahmure Alp
  • 25. time Your Device The Web Where can I find a-k-apart.com? It’s at 40.77.56.174 Response Hello 40.77.56.174 Howdy! I’d like /index.html Ok, here it is.  Icons by Mahmure Alp
  • 27.  Icons by Mahmure Alp Response Load Paint Layout RenderTree CSS DOM
  • 28.  Icons by Mahmure Alp Response Load Paint Layout RenderTree CSS DOM CSS & JavaScript can delay rendering or cause these to be run again
  • 29. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html>
  • 30. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html>
  • 31. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html>
  • 32. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html> wait while the browser
 fetches & parses the script
  • 33. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html> wait while the browser
 fetches & parses the CSS
  • 34. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html>
  • 35. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html>
  • 36. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html>
  • 37. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html>
  • 38. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html> kicks off downloading
 the image
  • 39. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html> wait while the browser
 fetches & parses the script
  • 40. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html>
  • 41. PERFORMANCE AS USER EXPERIENCE @AaronGustafson DOM Parsing <html> <head> <title>Silly example</title> <script src="head.js"></script> <link rel="stylesheet" href="main.css"> <style>h2 { font-weight: bold; }</style> <script>console.log('hi');</script> </head> <body> <img src="my.png" alt=""> <script src="body.js"></script> </body> </html>
  • 42. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Steps for better performance 1. Use native features whenever possible 2. Only include assets you actually need 3. Optimize everything 4. Think about when you load assets 5. Consider how you load assets 6. Only load assets when they add value 43
  • 43. Step 1:
 Use native features
 whenever possible
  • 45. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Por exemplo <header> Header content… </header> not only shorter than
 <div id=“header">, but
 semantic too depending on its location
in the document, could also
provide a landmark
for navigation
  • 46. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Por exemplo <input id="n" name="n" required aria-required="true" autocorrect="off"
 autocapitalize="words" placeholder="Sir Tim Berners Lee" autocomplete="name" > modern browsers require
 users to enter content browser can inform
 assistive tech that
 the field is required don’t let the browser
try to correct
someone’s name auto-disappearing suggestion
without JavaScript if the browser already
 knows the user’s name,
 by all means, let it fill it in
  • 47. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Por exemplo <input type="email"
 id="e" name="e"
 required aria-required="true"
 autocorrect="off"
 autocapitalize="off"
 autocomplete="email"
 placeholder="you@yourdomain.tld"
 > modern browsers validate
 the email address
 and may supply a
 custom keyboard layout let the browser suggest
 an email address if it has one
  • 48. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Por exemplo @media (min-width:600px) {
 .gridded { display: grid; grid-template-columns: 1fr 300px; grid-gap: 20px; }
 } So much better than floats
  • 49. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Por exemplo var $radios = document.querySelectorAll( 'input[type=radio]' ); CSS selector-based
 DOM traversal
 without a JS library
  • 50. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Por exemplo font-family: Georgia, Times,
 "Times New Roman", serif font-family: "Segoe UI", Frutiger,
 "Frutiger Linotype",
 "Dejavu Sans", "Helvetica Neue",
 Arial, sans-serif; Serif Sans Serif
  • 51.
  • 52. If you need
 a custom font:
 subset, subset, subset
  • 53. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Proceed with caution Source: Bran Stein
  • 54. Step 2:
 Only include assets
 you actually need
  • 56. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Every tool has a cost Framework Size (Compressed) Bootstrap 2 149 kB Bootstrap 3 103 kB Angular 1.4 51 kB Ember 2.2.0 111 kB Foundation 4 266 kB jQuery 32 kB UI Kit 86 kB React 16 + React DOM 35 kB Vue 2.4.2 20 kB
  • 57. Chances are, your
 library of choice
 is on a CDN
  • 58. time Your Device The Web Where can I find cdn.foo.com? It’s at 123.45.67.89  Icons by Mahmure Alp You can optimize this
  • 59. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Find the server early <link rel="dns-prefetch"
 href="https://cdn.foo.com"> Drop this in the
 head of your pages
  • 60. time Your Device The Web Where can I find cdn.foo.com? It’s at 123.45.67.89 Hello 123.45.67.89 Howdy!  Icons by Mahmure Alp You can optimize this
  • 61. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Go for the handshake <link rel="preconnect"
 href="https://cdn.foo.com">
  • 62. time Your Device The Web I’d like /jquery.min.js Ok, here it is.  Icons by Mahmure Alp You can even optimize this
  • 63. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Grab that resource <link rel="preload"
 href="https://cdn.foo.com/jquery.min.js"
 as="script"> Helps optimize the process
  • 64. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Download isn’t everything Source: The Filament Group
  • 65. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Download isn’t everything Framework Method/function operations/s Vanilla JS document.getElementById() 12,137,211 Dojo dojo.byId(); 5,443,343 Prototype $() 2,940,734 Ext JS Ext.get() 997,562 jQuery $() 350,557 YUI YAHOO.util.Dom.get() 326,534 MooTools document.id() 78,802 Source: VanillaJS
  • 67. PERFORMANCE AS USER EXPERIENCE @AaronGustafson We used some hints though <link rel="preconnect"
 href="//10kapart.blob.core.windows.net"> <link rel="preconnect"
 href="//cdnjs.cloudflare.com"> <link rel="preconnect"
 href="//www.google-analytics.com">
  • 69. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Our approach to CSS (Gulp) 1. Write modular CSS in Sass (+ Breakup for MQ management) 2. Compile CSS with a precision of 4 decimal places (gulp-sass) 3. Fallbacks for the last 2 browser versions (gulp-autoprefixer) 4. CSS shorthand declarations if possible (gulp-shorthand) 5. Remove any unused declarations/rule sets (gulp-uncss) 6. Optimize the files (gulp-csso) 7. Minify (gulp-clean-css) 8. Gzip (gulp-zopfli) 9. Brotli (gulp-brotli) 71
  • 70. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Before
  • 71. PERFORMANCE AS USER EXPERIENCE @AaronGustafson After everyone else
 8 kB browsers that support
 brotli compression
 2 kB browsers that support
gzip compression
3 kB
  • 72. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Our approach to JS (Gulp) 1. Write modular JavaScript, grouped as appropriate 2. Combine files based on folder structure (gulp-folders, gulp-concat) 3. Create an wrapping closure to isolate from other JS (gulp-insert) 4. Minify (gulp-uglify) 5. Gzip (gulp-zopfli) 6. Brotli (gulp-brotli) 74
  • 73. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Results about 8 kB all-up 4 kB 1 kB 2 kB
  • 74. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Interesting side note indexes last indexes first
  • 75. We also minified
 & pre-compressed
 our HTML
  • 76. Step 4:
 Think about when
 you load assets
  • 77. PERFORMANCE AS USER EXPERIENCE @AaronGustafson We had 10 JS files ๏ Global ‣ main.js - the site’s library ‣ serviceworker.js - The site’s service worker ๏ Browser-specific ‣ html5shiv.js - local copy of the HTML5 Shiv for < IE9 79
  • 78. PERFORMANCE AS USER EXPERIENCE @AaronGustafson We had 10 JS files ๏ Page-specific ‣ enter.js - Entry form-related code ‣ form-saver.js - Used to save form entries locally until submitted ‣ hero.js - Runs the SVG animation on the homepage ‣ home.js - Handles homepage-specific tasks ‣ project.js - Used on project pages during voting ‣ update.js - Handles the winner update form 80
  • 79. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Per the common wisdom <script src="/j/main.min.js"></script>
 </body>
 </html>
  • 80. PERFORMANCE AS USER EXPERIENCE @AaronGustafson No need to run immediately <script src="/j/main.min.js"></script>
 <script src="/j/home.min.js"
 defer
 ></script>
 </body>
 </html> run after the DOM is loaded
  • 81. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Run whenever you can <script src="/j/main.min.js"></script>
 <script src="/j/home.min.js"
 async
 ></script>
 </body>
 </html> run whenever it becomes
 available, but don’t
 delay page load
  • 82. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Consider dependencies <script src="/j/main.min.js" async></script>
 <script src="/j/home.min.js" async></script> what if this calls a function
 in main.min.js?
  • 84. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Avoid race conditions <script src="/j/main.min.js"></script>
 <script src="/j/home.min.js" async></script>
  • 86. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Connections in HTTP/1.1 Browser Per host Overall IE 9 6 35 IE 10 8 17 IE 11 13 17 Firefox 4+ 6 17 Opera 11+ 6 user defined Chrome 4+ 6 10 Safari 7+ 6 17
  • 87. time Your Device The Web HTTP/1.1  Icons by Mahmure Alp I’d like /c/main.css I’d like /j/main.min.js I’d like /i/o.svg I’d like /j/home.min.js I’d like /i/edge.svg I’d like /i/aea.svg
  • 88. HTTP/2 creates
 a single connection and contents stream in
  • 89. time Your Device The Web HTTP/2  Icons by Mahmure Alp I’d like /c/main.css I’d like /i/o.svg I’d like /i/edge.svg
  • 90. Source: A List Apart
  • 92. Source: A List Apart
  • 94. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Start simple <link rel="stylesheet" href="/c/d.min.css"> <link rel="stylesheet" href="/c/a.min.css"
 media="only screen"> default styles
(all browsers) advanced styles
 (modern browsers)
  • 95. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Fault tolerance FTW! <link rel="stylesheet" href="/c/d.min.css"> <link rel="stylesheet" href="/c/a.min.css"
 media="only screen"> browsers that don’t grok
 media queries ignore this file
  • 96. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Conditional scripting <!--[if lt IE 9]> <script src="/j/html5shiv.min.js"></script> <![endif]--> delivers this script
 to <= IE 8
  • 97. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Conditional scripting <!--[if gt IE 8]><!-->
 <script src="/j/main.min.js"></script>
 <script src="/j/home.min.js" async
 ></script>
 <!--<![endif]-->
 </body>
 </html> hides scripts from <= IE8
(no need to test!)
  • 98. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Conditional imagery
  • 99. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Conditional images @media (min-width: 36.375em) { .presented-by [href*=microsoft]::before { background-image: url(/i/c/edge.png); background-image: url(/i/c/edge.svg),
 none;
 … } }
  • 100. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Conditional images @media (min-width: 36.375em) { .presented-by [href*=microsoft]::before { background-image: url(/i/c/edge.png); background-image: url(/i/c/edge.svg),
 none;
 … } }
  • 101. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Conditional images @media (min-width: 36.375em) { .presented-by [href*=microsoft]::before { background-image: url(/i/c/edge.png); background-image: url(/i/c/edge.svg),
 none;
 … } } browsers that support
multiple backgrounds
also support SVG
  • 102. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Conditional animation
  • 103. PERFORMANCE AS USER EXPERIENCE @AaronGustafson How do we get there? JS? No No imageLoad Yes <> SVG support? Yes SVG Ajax request SVG
 Yank out script & add to document No picture Save the markup for
 next page load NoYes Verify browser width condition
  • 104. Step 6:
 Only load assets when they add value
  • 105.
  • 106.
  • 107. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Evaluate images case-by-case ๏ Does the image reiterate information found in the surrounding text? ๏ Is the image necessary to understand the surrounding content? ๏ Does the image contain text? ๏ Is the image a graph, chart, or table? ๏ Could the content of the image be presented in a different format that would not require an image? ๏ Is the image purely presentational? 111
  • 108. PERFORMANCE AS USER EXPERIENCE @AaronGustafson 53% of the average web page Source: Internet Archive
  • 109. PERFORMANCE AS USER EXPERIENCE @AaronGustafson And they don’t always fit
  • 111. If you can avoid
 using an image, do it
  • 112. If you need an image, choose the best format
  • 113. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Quick format recap ๏ GIF ‣ for images with large swaths of solid colors ‣ Binary transparency ๏ JPG ‣ For photographs and images with gradations of color ‣ Can be compressed (introduces artifacts) 117
  • 114. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Quick format recap ๏ PNG (8-Bit) ‣ Alternative to GIF ‣ Can support alpha transparency (with the right creation software) ๏ PNG (24-bit) ‣ Alternative to JPG ‣ Usually larger than JPGs ‣ Supports alpha tranparency 118
  • 115. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Quick format recap ๏ WebP ‣ Newer format, not universally supported ‣ Smaller than JPGs and 24-bit PNGs ‣ Support alpha transparency ‣ and so much more… 119
  • 117. that’s 29 kB of images
  • 118.
  • 119. PERFORMANCE AS USER EXPERIENCE @AaronGustafson How it works <li class="gallery__item h-card"
 data-img="/i/j/r.jpg||y"
 > <a href="https://twitter.com/rachelandrew">
 <b>Rachel Andrew</b>
 </a> </li> image path no alt necessary prepend to
 this list item
  • 120. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Getting CSS & JS in sync var $watcher = document.createElement('div'), re = /['"]/g; $watcher.setAttribute( 'id', 'getActiveMQ-watcher' ); $watcher.style.display = 'none'; document.body.appendChild( $watcher ); window.getActiveMQ = function() { return window.getComputedStyle( $watcher, null ) .getPropertyValue( 'font-family' ) .replace( re, '' ); };
  • 121. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Getting CSS & JS in sync #getActiveMQ-watcher { font-family: global; } @media (min-width: 15em) { #getActiveMQ-watcher { font-family: tiny; } } @media (min-width: 20em) { #getActiveMQ-watcher { font-family: small; } } @media (min-width: 30em) { #getActiveMQ-watcher { font-family: medium; } } @media (min-width: 40em) { #getActiveMQ-watcher { font-family: large; } } @media (min-width: 48.75em) { #getActiveMQ-watcher { font-family: larger; } } @media (min-width: 60em) { #getActiveMQ-watcher { font-family: full; } }
  • 122. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Getting CSS & JS in sync var $watcher = document.createElement('div'), re = /['"]/g; $watcher.setAttribute( 'id', 'getActiveMQ-watcher' ); $watcher.style.display = 'none'; document.body.appendChild( $watcher ); window.getActiveMQ = function() { return window.getComputedStyle( $watcher, null ) .getPropertyValue( 'font-family' ) .replace( re, '' ); };
  • 123. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Getting CSS & JS in sync var MQ = getActiveMQ(); if ( MQ == 'larger' || MQ == 'full' ) { lazyLoadImages(); }
  • 124. PERFORMANCE AS USER EXPERIENCE @AaronGustafson How it works <li class="gallery__item h-card"
 data-img="/i/j/r.jpg||y"
 > <a href="https://twitter.com/rachelandrew">
 <b>Rachel Andrew</b>
 </a> </li>
  • 125. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Result! <li class="gallery__item h-card"
 data-img="/i/j/r.jpg||y"
 data-imaged="true"
 >
 <img src="/i/j/r.jpg" alt="">
 <a href="https://twitter.com/rachelandrew">
 <b>Rachel Andrew</b>
 </a> </li>
  • 127.
  • 128.
  • 130. B&W: 35 kB JPG (-7%)
  • 131. Crop & Resize: 12 kB JPG (-68%)
  • 132. Blur & optimize: 9 kB JPG (-76%)
  • 134. WebP: 4 kB (-89%)JPG: 9 kB (-76%)
  • 136. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Indicating alternate formats <picture> <source type="image/webp" srcset="my.webp">
 <img src="my.jpg" alt="Alt text goes here"> </picture> first choice if
WebP is supported fallback image
 if it isn’t
  • 137. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Indicating alternate formats <picture> <source type="image/svg+xml"
 srcset="my.svg"> <source type="image/webp" srcset="my.webp">
 <img src="my.jpg" alt="Alt text goes here"> </picture>
  • 138. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Indicating alternate formats <li class="gallery__item h-card"
 data-img="/i/j/r.jpg||y"
 data-imaged="true"
 >
 <img src="/i/j/r.jpg" alt="">
 <a href="https://twitter.com/rachelandrew">
 <b>Rachel Andrew</b>
 </a> </li>
  • 139. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Indicating alternate formats <li class="gallery__item h-card"
 data-img="/i/j/r.jpg||y"
 data-imaged="true"
 >
 <picture>
 <source type="image/webp"
 srcset="/i/j/r.webp">
 <img src="/i/j/r.jpg" alt="">
 </picture> <a href="https://twitter.com/rachelandrew">
 <b>Rachel Andrew</b>
 </a> </li>
  • 140. PERFORMANCE AS USER EXPERIENCE @AaronGustafson Steps for better performance 1. Use native features whenever possible 2. Only include assets you actually need 3. Optimize everything 4. Think about when you load assets 5. Consider how you load assets 6. Only load assets when they add value 146
  • 141. Every choice we
 make affects our
 users’ experiences
  • 142. Let’s spend our time to
 save it for our users
  • 143. Speedy performance is
 a great user experience