SlideShare a Scribd company logo
Web Performance:
Behind the Scenes
By Mark Tomlinson,
The Performance Sherpa
Mark Tomlinson
- The Performance Sherpa
- 27 years doing performance things
- Former Microsoft, HP & PayPal
- PerfBytes Podcaster
- STPRadio Podcaster
- Speaker and Teacher on Performance
- Online mentoring and coaching
- Currently full-time at a startup in Philly
It all started with Steve
Souders’ realization that
we needed more focus on
client-side performance.
<- so he wrote this
book
...and it was such a
total hit with
engineers around
the world, he
decided to write
another one ->
RULES FORWEB PERFORMANCE
9. Adopt Website Monitoring
10. Prefetch and reconnect
11. SSL certificate/ HTTPS
12. Web Font Performance
13. Hotlink protection
14. 404 Errors
15. Infrastructure
16. Database Optimization
1. HTTP requests reduction
2. File compression
3. Web caching optimization
4. Code minification
5. Lossy compression
6. Replacement of vector graphics
7. Image Optimization
8. 301 Redirects
Everyone agrees on a basic list of guidelines for web perf:
Source: https://apiumhub.com/tech-blog-barcelona/web-performance-optimization-techniques/
RULES FORWEB PERFORMANCE
Thou shall not block thy
DOM.
Browser: use localbrowser caching?
Local resources are fastest:
• reduces round-trip http requests
• retrieved from local storage
• Web Storage API
• IndexedDB API
• New: Cache API
Gotchas:
• far-futures expires headers on
locally cached content specific to
functionality or branding
• Limits on storage space and speed
Put your CSS at the top of the page:
• avoid the “waiting on a blank page”
• immediately style the DOM after it loads
• CSSOM is created immediately after the DOM
Put your javascript at the bottom of the page:
• Scripts act upon the DOM/CSSOM
• Only really useful after the page is active
• Loading a script resource blocks HMTL and
CSS
Generally avoid “embedded” script or css
Browser: css andjavascript placement
Browser: async javascript loading?
Script tags have 2 steps:
• Load the script (local or remote)
• Execute the script
With async (or defer):
• the script download will not block
• html and css will render (DOM/CSSOM)
Be careful again:
• if script is required for functionality
• if javascript makes remote calls
Browser: prefetch andreconnect?
Perception of Performance Improvement:
• Pre-loading the “next” page/resource
• Runs “in the background”
• If user clicks on a link, it seems fast!
Three main kinds of prefetch:
• Link Prefetching
• DNS Prefetching
• Prerendering
Watch out: bandwidth limitations anyone
Browser: replace vector graphics?
Raster Images are mostly bad!
• Made of pixels in a grid
• Non-responsive
• Larger images = more pixels
Scalar Vector Graphics are GOOD!
• Small source size
• Responsive and scales up
• Minimal CPU to dynamically/resize
Gotcha: complex SVG can get big
Alternative: use “srcset” or “picture” tags
Browser: webfont performance?
Basics of web fonts:
• Unicode fonts can contain thousands of glyphs.
• There are four font formats: WOFF2, WOFF, EOT,
and TTF.
• Some font formats require the use of
compression.
Optimizing:
• Each font is an additional resource (round-trip)
• Some fonts can “block” the text rendering
• Use local() and url() directives for font-family
System:makefewer requests?
The starting point for all web optimization:
• Each remote resource requires a round-trip to/from
• always having some network latency
• always has at least 1 DNS lookup
• Generating the remote resource relies on back-end
systems? Storage? Database? Messaging?
Optimizing:
• load more content in a single roundtrip
• reduce the remote resources required to render
• use HTTP/2+ which helps do this for you
System:usenetwork caching?
Content Distribution Network (Akamai):
If you must make a round-trip:
• …maybe only go half-way?
• content can live in a “network cache”
• reduces load on the actual origin server
• has “time-to-live” settings
• programmatic API for CDN content
CDN Gotchas:
• pre-distributing large static content (video)
System:usefile compression?
Make big things smaller:
• any file-based resource can be compressed
• reduce network transfer time
• reduce remote storage
• Gzip is most common, also see Brotili
Compression Gotchas:
• requires cpu to compress on the server
• requires cpu to decompress on client
• requires time to compress on the server
• requires time to decompress on the client
System:minifyyourcode?
“Why you sendin’ all that white space?”
Pre-parsing code to be smaller size:
• reduces transfer time & bandwidth
• removing superfluous characters
• most end-users will not read your code
• most everyone will not ready comments
Optimizing:
• works on CSS, JS, and HTML and other code
• have both minified & non-minified versions
System:avoid404 not-foundand301 redirects?
Avoid 404 Not Found:
• why make the round-trip?
• fast, but still blocks a connection
• fast, but still hits the server
• consider caching custom 404’s
Avoid 301 Redirects:
• why make the round-trip?
• paying twice for 1 resource
• might be fast, but blocks a connection
• fast, but still hits the server
• consider a cache-header
LoadTesting – ISSTILL RELEVANT!!
Consider the last 2 items:
• #15 is Infrastructure
• #16 is Database Optimization
WELL OF COURSE!!!!
• finding and removing bottlenecks
• optimizing data source queries
• tuning the system bottom-up
• applying elastic scaling
• monitor all the things!
Thank you!!
Mark Tomlinson
The Performance Sherpa
@perfsherpa
PerfBytes Podcasting
www.perfbytes.com

More Related Content

ZIP
High Performance WordPress - WordCamp Jerusalem 2010
PDF
High Performance WordPress II
PDF
WebAssembly vs JavaScript: What is faster?
PPTX
Wordcamp2009
PDF
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
PDF
Speed Up Wordpress, Wordpress Horsepower
PPTX
Speed up Your Joomla Site for Ultimate Performance
PDF
Cache is keeping you from reaching the full potential as a developer (word ca...
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress II
WebAssembly vs JavaScript: What is faster?
Wordcamp2009
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
Speed Up Wordpress, Wordpress Horsepower
Speed up Your Joomla Site for Ultimate Performance
Cache is keeping you from reaching the full potential as a developer (word ca...

What's hot (20)

PPTX
WordPress + NGINX Best Practices with EasyEngine
PDF
Meta Refresh 2014
PDF
Metarefresh
PDF
WordPress Optimization with Litespeed Cache #wpjkt14
PDF
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...
PDF
Leeward WordPress Meetup- Caching and Website Speed
PPTX
Windows Azure Service Bus
PDF
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
PPTX
Word press workflows and gulp
PDF
Webpack & React Performance in 16+ Steps
PDF
SSDs are Awesome
PDF
Debugging WordPress Performance using EasyEngine
PDF
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
PDF
Hhvm and wordpress
PDF
Highly available Drupal on a Raspberry Pi cluster
PPTX
What is a good technology stack today?
PPT
Shopzilla - Performance By Design
PDF
Building faster websites: web performance with WordPress
PDF
Wordpress horsepower
PPT
20130714 php matsuri - highly available php
WordPress + NGINX Best Practices with EasyEngine
Meta Refresh 2014
Metarefresh
WordPress Optimization with Litespeed Cache #wpjkt14
2013 - Igor Sysoev - NGINx: origen, evolución y futuro - PHP Conference Argen...
Leeward WordPress Meetup- Caching and Website Speed
Windows Azure Service Bus
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Word press workflows and gulp
Webpack & React Performance in 16+ Steps
SSDs are Awesome
Debugging WordPress Performance using EasyEngine
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
Hhvm and wordpress
Highly available Drupal on a Raspberry Pi cluster
What is a good technology stack today?
Shopzilla - Performance By Design
Building faster websites: web performance with WordPress
Wordpress horsepower
20130714 php matsuri - highly available php
Ad

Similar to PAC 2019 virtual Mark Tomlinson (20)

PPT
performance.ppt
PDF
Web Performance Optimization (WPO)
PPTX
Delivering Mobile Apps That Perform
PDF
#Webperf Choreography
KEY
Optimization of modern web applications
PPT
Tips for a Faster Website
PDF
20 tips for website performance
ODP
Cvcc performance tuning
PPTX
10 Things You Can Do to Speed Up Your Web App Today
PPTX
Drupal performance optimization Best Practices
PDF
12-Step Program for Scaling Web Applications on PostgreSQL
PDF
Code for Startup MVP (Ruby on Rails) Session 1
PDF
Hacking Web Performance
PPT
Configuring Apache Servers for Better Web Perormance
PDF
Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014
PPTX
Building Lightning Fast Websites (for Twin Cities .NET User Group)
PPTX
Building Faster Websites
PPTX
Learn from my Mistakes - Building Better Solutions in SPFx
PDF
23 Ways To Speed Up WordPress
performance.ppt
Web Performance Optimization (WPO)
Delivering Mobile Apps That Perform
#Webperf Choreography
Optimization of modern web applications
Tips for a Faster Website
20 tips for website performance
Cvcc performance tuning
10 Things You Can Do to Speed Up Your Web App Today
Drupal performance optimization Best Practices
12-Step Program for Scaling Web Applications on PostgreSQL
Code for Startup MVP (Ruby on Rails) Session 1
Hacking Web Performance
Configuring Apache Servers for Better Web Perormance
Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014
Building Lightning Fast Websites (for Twin Cities .NET User Group)
Building Faster Websites
Learn from my Mistakes - Building Better Solutions in SPFx
23 Ways To Speed Up WordPress
Ad

More from Neotys (20)

PPTX
PAC 2020 Santorin - Giovanni Paolo Gibilisco
PPTX
PAC 2020 Santorin - Stijn Schepers
PPTX
PAC 2020 Santorin - Edoardo Varani
PPTX
PAC 2020 Santorin - Andreas Grabner
PPTX
PAC 2020 Santorin - Vasilis Chatzinasios
PPTX
PAC 2020 Santorin - Gopalkrishnan Yadav
PPTX
PAC 2020 Santorin - Hari Krishnan Ramachandran
PPTX
PAC 2020 Santorin - Joerek Van Gaalen
PPTX
PAC 2020 Santorin - Ankur Jain
PPTX
PAC 2020 Santorin - Stephen Townshend
PPTX
PAC 2020 Santorin - Leandro Melendez
PPTX
PAC 2019 virtual Stephen Townshend
PDF
PAC 2019 virtual Federico Toledo
PDF
PAC 2019 virtual Leandro Melendez
PDF
PAC 2019 virtual Srivalli Aparna
PDF
PAC 2019 virtual Reuben Rajan George
PDF
PAC 2019 virtual Joerek Van Gaalen
PDF
PAC 2019 virtual Hemalatha Murugesan
PDF
PAC 2019 virtual Bruno Audoux
PDF
PAC 2019 virtual Arjan Van Den Berg
PAC 2020 Santorin - Giovanni Paolo Gibilisco
PAC 2020 Santorin - Stijn Schepers
PAC 2020 Santorin - Edoardo Varani
PAC 2020 Santorin - Andreas Grabner
PAC 2020 Santorin - Vasilis Chatzinasios
PAC 2020 Santorin - Gopalkrishnan Yadav
PAC 2020 Santorin - Hari Krishnan Ramachandran
PAC 2020 Santorin - Joerek Van Gaalen
PAC 2020 Santorin - Ankur Jain
PAC 2020 Santorin - Stephen Townshend
PAC 2020 Santorin - Leandro Melendez
PAC 2019 virtual Stephen Townshend
PAC 2019 virtual Federico Toledo
PAC 2019 virtual Leandro Melendez
PAC 2019 virtual Srivalli Aparna
PAC 2019 virtual Reuben Rajan George
PAC 2019 virtual Joerek Van Gaalen
PAC 2019 virtual Hemalatha Murugesan
PAC 2019 virtual Bruno Audoux
PAC 2019 virtual Arjan Van Den Berg

Recently uploaded (20)

PDF
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
PPTX
Road Safety tips for School Kids by a k maurya.pptx
PDF
Queuing formulas to evaluate throughputs and servers
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
PDF
Geotechnical Engineering, Soil mechanics- Soil Testing.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPT
Project quality management in manufacturing
DOCX
573137875-Attendance-Management-System-original
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PDF
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
PPTX
OOP with Java - Java Introduction (Basics)
PDF
composite construction of structures.pdf
PPTX
Internship_Presentation_Final engineering.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
436813905-LNG-Process-Overview-Short.pptx
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
Road Safety tips for School Kids by a k maurya.pptx
Queuing formulas to evaluate throughputs and servers
UNIT-1 - COAL BASED THERMAL POWER PLANTS
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
Geotechnical Engineering, Soil mechanics- Soil Testing.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Structs to JSON How Go Powers REST APIs.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Project quality management in manufacturing
573137875-Attendance-Management-System-original
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
OOP with Java - Java Introduction (Basics)
composite construction of structures.pdf
Internship_Presentation_Final engineering.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
436813905-LNG-Process-Overview-Short.pptx

PAC 2019 virtual Mark Tomlinson

  • 1. Web Performance: Behind the Scenes By Mark Tomlinson, The Performance Sherpa
  • 2. Mark Tomlinson - The Performance Sherpa - 27 years doing performance things - Former Microsoft, HP & PayPal - PerfBytes Podcaster - STPRadio Podcaster - Speaker and Teacher on Performance - Online mentoring and coaching - Currently full-time at a startup in Philly
  • 3. It all started with Steve Souders’ realization that we needed more focus on client-side performance. <- so he wrote this book ...and it was such a total hit with engineers around the world, he decided to write another one ->
  • 4. RULES FORWEB PERFORMANCE 9. Adopt Website Monitoring 10. Prefetch and reconnect 11. SSL certificate/ HTTPS 12. Web Font Performance 13. Hotlink protection 14. 404 Errors 15. Infrastructure 16. Database Optimization 1. HTTP requests reduction 2. File compression 3. Web caching optimization 4. Code minification 5. Lossy compression 6. Replacement of vector graphics 7. Image Optimization 8. 301 Redirects Everyone agrees on a basic list of guidelines for web perf: Source: https://apiumhub.com/tech-blog-barcelona/web-performance-optimization-techniques/
  • 5. RULES FORWEB PERFORMANCE Thou shall not block thy DOM.
  • 6. Browser: use localbrowser caching? Local resources are fastest: • reduces round-trip http requests • retrieved from local storage • Web Storage API • IndexedDB API • New: Cache API Gotchas: • far-futures expires headers on locally cached content specific to functionality or branding • Limits on storage space and speed
  • 7. Put your CSS at the top of the page: • avoid the “waiting on a blank page” • immediately style the DOM after it loads • CSSOM is created immediately after the DOM Put your javascript at the bottom of the page: • Scripts act upon the DOM/CSSOM • Only really useful after the page is active • Loading a script resource blocks HMTL and CSS Generally avoid “embedded” script or css Browser: css andjavascript placement
  • 8. Browser: async javascript loading? Script tags have 2 steps: • Load the script (local or remote) • Execute the script With async (or defer): • the script download will not block • html and css will render (DOM/CSSOM) Be careful again: • if script is required for functionality • if javascript makes remote calls
  • 9. Browser: prefetch andreconnect? Perception of Performance Improvement: • Pre-loading the “next” page/resource • Runs “in the background” • If user clicks on a link, it seems fast! Three main kinds of prefetch: • Link Prefetching • DNS Prefetching • Prerendering Watch out: bandwidth limitations anyone
  • 10. Browser: replace vector graphics? Raster Images are mostly bad! • Made of pixels in a grid • Non-responsive • Larger images = more pixels Scalar Vector Graphics are GOOD! • Small source size • Responsive and scales up • Minimal CPU to dynamically/resize Gotcha: complex SVG can get big Alternative: use “srcset” or “picture” tags
  • 11. Browser: webfont performance? Basics of web fonts: • Unicode fonts can contain thousands of glyphs. • There are four font formats: WOFF2, WOFF, EOT, and TTF. • Some font formats require the use of compression. Optimizing: • Each font is an additional resource (round-trip) • Some fonts can “block” the text rendering • Use local() and url() directives for font-family
  • 12. System:makefewer requests? The starting point for all web optimization: • Each remote resource requires a round-trip to/from • always having some network latency • always has at least 1 DNS lookup • Generating the remote resource relies on back-end systems? Storage? Database? Messaging? Optimizing: • load more content in a single roundtrip • reduce the remote resources required to render • use HTTP/2+ which helps do this for you
  • 13. System:usenetwork caching? Content Distribution Network (Akamai): If you must make a round-trip: • …maybe only go half-way? • content can live in a “network cache” • reduces load on the actual origin server • has “time-to-live” settings • programmatic API for CDN content CDN Gotchas: • pre-distributing large static content (video)
  • 14. System:usefile compression? Make big things smaller: • any file-based resource can be compressed • reduce network transfer time • reduce remote storage • Gzip is most common, also see Brotili Compression Gotchas: • requires cpu to compress on the server • requires cpu to decompress on client • requires time to compress on the server • requires time to decompress on the client
  • 15. System:minifyyourcode? “Why you sendin’ all that white space?” Pre-parsing code to be smaller size: • reduces transfer time & bandwidth • removing superfluous characters • most end-users will not read your code • most everyone will not ready comments Optimizing: • works on CSS, JS, and HTML and other code • have both minified & non-minified versions
  • 16. System:avoid404 not-foundand301 redirects? Avoid 404 Not Found: • why make the round-trip? • fast, but still blocks a connection • fast, but still hits the server • consider caching custom 404’s Avoid 301 Redirects: • why make the round-trip? • paying twice for 1 resource • might be fast, but blocks a connection • fast, but still hits the server • consider a cache-header
  • 17. LoadTesting – ISSTILL RELEVANT!! Consider the last 2 items: • #15 is Infrastructure • #16 is Database Optimization WELL OF COURSE!!!! • finding and removing bottlenecks • optimizing data source queries • tuning the system bottom-up • applying elastic scaling • monitor all the things!
  • 18. Thank you!! Mark Tomlinson The Performance Sherpa @perfsherpa PerfBytes Podcasting www.perfbytes.com