SlideShare a Scribd company logo
1 of 60
Download to read offline
Lead UI Developer
at Field Intelligence
Anna Migas
Google Developer Expert
Anna Migas
@szynszyliszys
The secret web
performance metric
no one is talking about
“Web performance refers to the
speed in which web pages are
downloaded and displayed
on the user's web browser“
wikipedia.org/wiki/Web_performance
web performance
User experience connected to the
web performance
User experience connected to the
web performance
from a perspec
ti
ve of an average
user in Africa
Why should you care?
Africa is far.
It is a problem for anyone:
1. Using an old device
2. Located in a rural area
3. Using an enterprise app that is
hard to op
ti
mise
Most web performance
metrics and resources
are developed with a
privileged user in mind.
For some users, the
good web performance
is not achievable at all.
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
h
tt
ps://www.webperf.
ti
ps/
ti
p/cached-js-misconcep
ti
ons/
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
h
tt
ps://www.webperf.
ti
ps/
ti
p/cached-js-misconcep
ti
ons/
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
h
tt
ps://www.webperf.
ti
ps/
ti
p/cached-js-misconcep
ti
ons/
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
h
tt
ps://www.webperf.
ti
ps/
ti
p/cached-js-misconcep
ti
ons/
Latency
Latency is generally considered to be the
amount of
ti
me it takes from when a request is
made by the user to the
ti
me it takes for the
response to get back to that user.
h
tt
ps://developer.mozilla.org/en-US/docs/Web/Performance/
Latency in most parts of
Africa is really high.
High latency means long
Time To First Byte
(TTFB).
Latency in most parts of
Africa is really high.
High latency means long
Time To First Byte
(TTFB).
“While a good TTFB doesn’t
necessarily mean you will have a
fast website, a bad TTFB almost
certainly guarantees a slow one.”
— Harry Roberts
h
tt
ps://csswizardry.com/2019/08/
ti
me-to-
fi
rst-byte-what-it-is-and-why-it-ma
tt
ers/
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
Devices used
“The country [Nigeria] is considered a mobile-
fi
rst market where infrastructure and online
usage development skipped wide-ranging
desktop PC adop
ti
on and went straight to
mobile internet usage via inexpensive
smartphones instead.”
h
tt
ps://www.sta
ti
sta.com/sta
ti
s
ti
cs/183849/internet-users-nigeria/
“Time spent in Parse/Compile can
often be 2–5x as long on phones
as on desktop.”
— Addy Osmani
h
tt
ps://medium.com/reloading/javascript-start-up-performance-69200f43b201
h
tt
ps://medium.com/reloading/javascript-start-up-performance-69200f43b201
Secret web
performance metric:
Pa
ti
ence
How long are you willing
to wait for the website to
load, before you decide
it is broken?
Pa
ti
ence metric:
If everything is slow,
what can we do?
1. Visibility of system
status
“The design should always keep users
informed about what is going on, through
appropriate feedback within a reasonable
amount of
ti
me.”
h
tt
ps://www.nngroup.com/ar
ti
cles/ten-usability-heuris
ti
cs/
1. Visibility of system
status
“The design should always keep users
informed about what is going on, through
appropriate feedback within a reasonable
amount of
ti
me.”
h
tt
ps://www.nngroup.com/ar
ti
cles/ten-usability-heuris
ti
cs/
Make sure to give user informa
ti
on
as fast as possible:
• What is going on
• How long it can take
• Once error occurs (and what can be done)
Take into account digital literacy
• Use simple language
• Discourage damaging ac
ti
ons (“Do you
really want to navigate out and stop the
ongoing download?”)
• Explain consequences of ac
ti
ons (for
example “pull to refresh”)
2. Render ini
ti
al
informa
ti
on ASAP
Make sure there is some ini
ti
al content visible
le
tti
ng user know what is going on quick.
3. Leverage Progressive
Enhancement
Make it possible to achieve the most crucial
ac
ti
on
fi
rst, add extra features and
fi
reworks
on top of that.
4. Avoid request
chaining and roundtrips
Consider using browser hints.
A. Preconnect
Eliminate many costly roundtrips from your
request path (for example establish
connec
ti
on with CDN used later)
<link href="https://cdn.domain.com" rel="preconnect"
crossorigin>
B. Prefetch
Fetch resources and store them in cache.
Use for resources that might be needed for
next naviga
ti
on.
<link rel="prefetch" href="/images/big.jpeg">
C. Preload
Load late-discovered resources early.
<link rel="preload" href="font.woff2" as="font"
type="font/woff2" crossorigin>
5. Lazy load resources
that are not cri
ti
cal
Don’t force user to download resources they
might never discover.
<img src="image.png" loading="lazy" alt=“alt text”
width="200" height="200">
6. Op
ti
mise images you
ship
Images are usually the heaviest resources on
the web.
Op
ti
mise image loading
• Use correct and modern formats
• Use tools to op
ti
mise size:
• h
tt
ps://jakearchibald.github.io/svgomg/
• h
tt
ps://squoosh.app/
• h
tt
ps://imageop
ti
m.com
Op
ti
mise image loading
• Add size / aspect ra
ti
o to avoid layout
shifts
.img-class { aspect-ratio: 16 / 9; }
.img-class
{

width: 100px
;

height: 20px
;

}
7. Learn about network
resource hints
Network Informa
ti
on API helps web
applica
ti
ons to access informa
ti
on about the
user's network.
navigator.connection.saveData
h
tt
ps://developer.mozilla.org/en-US/docs/Web/API/Network_Informa
ti
on_API
8. Limit third party
resources
Third party resources can delay ini
ti
al load of
the page. Load them asynchronously
whenever possible.
<script async src="external.js"></script>
<script defer src="external.js"></script>
9. Test for back/forward
cache
If a user clicks on a naviga
ti
on item by
mistake, it can minimise the
ti
me to navigate
back.
h
tt
ps://developer.chrome.com/docs/devtools/applica
ti
on/back-forward-cache/
h
tt
ps://web.dev/bfcache/
10. Consider using
Service Worker
If you expect your page to be visited on regular
basis, you can cache resources be
tt
er.
h
tt
ps://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
11. Avoid crea
ti
ng too
many layers
Each layer created by the browser takes
device’s resources.
h
tt
ps://blog.logrocket.com/eliminate-content-repaints-with-the-new-layers-panel-in-
chrome-e2c306d4d752/
12. Minimise website
repaints
While interac
ti
ng with the page, a lot of
interac
ti
ve resources can force browser to
repaint content.
h
tt
ps://web.dev/simplify-paint-complexity-and-reduce-paint-areas/
Summary
★ Let user know what is going on
★ Load ini
ti
al informa
ti
on early
★ Progressively enhance your website
★ Avoid request chaining and use resource
hints
★ Lazy load content below the fold
★ Op
ti
mise images
★ Leverage Network Informa
ti
on API
Summary
★ Limit third party resources (and if you need
them use async loading)
★ Op
ti
mise for back/forward cache
★ Consider using Service Worker if applicable
★ Avoid using too many layers and repain
ti
ng
content
Resources
• MDN: Understanding latency
h
tt
ps://developer.mozilla.org/en-US/docs/Web/Performance/
Understanding_latency
• Interac
ti
ve map of network speed worldwide
h
tt
ps://www.cable.co.uk/broadband/speed/worldwide-speed-
league/
• The African web ecosystem - a paper
h
tt
ps://www.caida.org/catalog/papers/
2018_exploring_analysing_african_web/
exploring_analysing_african_web.pdf
Resources
• web.dev: Establishing early connec
ti
ons with resource hints
h
tt
ps://web.dev/preconnect-and-dns-prefetch/
• web.dev: Preloading cri
ti
cal assets
h
tt
ps://web.dev/preload-cri
ti
cal-assets/
• web.dev: Loading third party assets
h
tt
ps://web.dev/e
ffi
ciently-load-third-party-javascript/
Resources
• The psychology of web performance
h
tt
ps://blog.uptrends.com/web-performance/the-psychology-of-
web-performance/
• Designer's guide to perceived web performance
h
tt
ps://marvelapp.com/blog/a-designers-guide-to-perceived-
performance/
Anna Migas
@szynszyliszys
Thank you!

More Related Content

Similar to Secret Performance Metric - Armada JS.pdf

Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Imran Sayed
 
Let's Take Drupal Offline!
Let's Take Drupal Offline!Let's Take Drupal Offline!
Let's Take Drupal Offline!Dick Olsson
 
Supercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy UsersSupercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy UsersNGINX, Inc.
 
Progressive Web Apps by Millicent Convento
Progressive Web Apps by Millicent ConventoProgressive Web Apps by Millicent Convento
Progressive Web Apps by Millicent ConventoDEVCON
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandImran Sayed
 
WebE_chapter_16.ppt
WebE_chapter_16.pptWebE_chapter_16.ppt
WebE_chapter_16.pptUsamaPatel9
 
Basic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsBasic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsAnjaliTanpure1
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWhat is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWPSFO Meetup Group
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Prolifics
 
Demystifying web performance tooling and metrics
Demystifying web performance tooling and metricsDemystifying web performance tooling and metrics
Demystifying web performance tooling and metricsAnna Migas
 
Business of Front-end Web Development
Business of Front-end Web DevelopmentBusiness of Front-end Web Development
Business of Front-end Web DevelopmentRachel Andrew
 
How to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - EnglishHow to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - EnglishKoombea
 
Basic Introduction to Web Development
Basic Introduction to Web DevelopmentBasic Introduction to Web Development
Basic Introduction to Web DevelopmentBurhan Khalid
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developersFilip Rakowski
 
Doug Sillars on App Optimization
Doug Sillars on App OptimizationDoug Sillars on App Optimization
Doug Sillars on App Optimizationwipjam
 

Similar to Secret Performance Metric - Armada JS.pdf (20)

Progressive Web Apps are here!
Progressive Web Apps are here!Progressive Web Apps are here!
Progressive Web Apps are here!
 
Browser Based Performance Testing and Tuning
Browser Based Performance Testing and TuningBrowser Based Performance Testing and Tuning
Browser Based Performance Testing and Tuning
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020
 
Let's Take Drupal Offline!
Let's Take Drupal Offline!Let's Take Drupal Offline!
Let's Take Drupal Offline!
 
Supercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy UsersSupercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy Users
 
Progressive Web Apps by Millicent Convento
Progressive Web Apps by Millicent ConventoProgressive Web Apps by Millicent Convento
Progressive Web Apps by Millicent Convento
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp Finland
 
Presemtation Tier Optimizations
Presemtation Tier OptimizationsPresemtation Tier Optimizations
Presemtation Tier Optimizations
 
WebE_chapter_16.ppt
WebE_chapter_16.pptWebE_chapter_16.ppt
WebE_chapter_16.ppt
 
Basic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsBasic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web Apps
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWhat is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress Hosting
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
 
Demystifying web performance tooling and metrics
Demystifying web performance tooling and metricsDemystifying web performance tooling and metrics
Demystifying web performance tooling and metrics
 
Business of Front-end Web Development
Business of Front-end Web DevelopmentBusiness of Front-end Web Development
Business of Front-end Web Development
 
How to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - EnglishHow to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - English
 
Progressive Web Apps - NPD Meet
Progressive Web Apps - NPD MeetProgressive Web Apps - NPD Meet
Progressive Web Apps - NPD Meet
 
Basic Introduction to Web Development
Basic Introduction to Web DevelopmentBasic Introduction to Web Development
Basic Introduction to Web Development
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developers
 
Doug Sillars on App Optimization
Doug Sillars on App OptimizationDoug Sillars on App Optimization
Doug Sillars on App Optimization
 
WTF R PWAs?
WTF R PWAs?WTF R PWAs?
WTF R PWAs?
 

More from Anna Migas

HalfStack fast but not furious
HalfStack fast but not furiousHalfStack fast but not furious
HalfStack fast but not furiousAnna Migas
 
Performance.now() fast but not furious
Performance.now()   fast but not furiousPerformance.now()   fast but not furious
Performance.now() fast but not furiousAnna Migas
 
NordicJS: Fast but not Furious: Debugging User Interaction Performance Issues
NordicJS:  Fast but not Furious: Debugging User Interaction Performance IssuesNordicJS:  Fast but not Furious: Debugging User Interaction Performance Issues
NordicJS: Fast but not Furious: Debugging User Interaction Performance IssuesAnna Migas
 
Fullstack 2018 - Fast but not furious: debugging user interaction performanc...
Fullstack 2018 -  Fast but not furious: debugging user interaction performanc...Fullstack 2018 -  Fast but not furious: debugging user interaction performanc...
Fullstack 2018 - Fast but not furious: debugging user interaction performanc...Anna Migas
 
Fast but not furious: debugging user interaction performance issues
Fast but not furious: debugging user interaction performance issuesFast but not furious: debugging user interaction performance issues
Fast but not furious: debugging user interaction performance issuesAnna Migas
 
Web Zurich - Make your animations perform well
Web Zurich - Make your animations perform wellWeb Zurich - Make your animations perform well
Web Zurich - Make your animations perform wellAnna Migas
 
HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well Anna Migas
 
Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Anna Migas
 
Make your animations perform well
Make your animations perform wellMake your animations perform well
Make your animations perform wellAnna Migas
 
Be brave and Open Source
Be brave and Open SourceBe brave and Open Source
Be brave and Open SourceAnna Migas
 

More from Anna Migas (10)

HalfStack fast but not furious
HalfStack fast but not furiousHalfStack fast but not furious
HalfStack fast but not furious
 
Performance.now() fast but not furious
Performance.now()   fast but not furiousPerformance.now()   fast but not furious
Performance.now() fast but not furious
 
NordicJS: Fast but not Furious: Debugging User Interaction Performance Issues
NordicJS:  Fast but not Furious: Debugging User Interaction Performance IssuesNordicJS:  Fast but not Furious: Debugging User Interaction Performance Issues
NordicJS: Fast but not Furious: Debugging User Interaction Performance Issues
 
Fullstack 2018 - Fast but not furious: debugging user interaction performanc...
Fullstack 2018 -  Fast but not furious: debugging user interaction performanc...Fullstack 2018 -  Fast but not furious: debugging user interaction performanc...
Fullstack 2018 - Fast but not furious: debugging user interaction performanc...
 
Fast but not furious: debugging user interaction performance issues
Fast but not furious: debugging user interaction performance issuesFast but not furious: debugging user interaction performance issues
Fast but not furious: debugging user interaction performance issues
 
Web Zurich - Make your animations perform well
Web Zurich - Make your animations perform wellWeb Zurich - Make your animations perform well
Web Zurich - Make your animations perform well
 
HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well
 
Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017
 
Make your animations perform well
Make your animations perform wellMake your animations perform well
Make your animations perform well
 
Be brave and Open Source
Be brave and Open SourceBe brave and Open Source
Be brave and Open Source
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Secret Performance Metric - Armada JS.pdf

  • 1. Lead UI Developer at Field Intelligence Anna Migas Google Developer Expert
  • 2. Anna Migas @szynszyliszys The secret web performance metric no one is talking about
  • 3. “Web performance refers to the speed in which web pages are downloaded and displayed on the user's web browser“ wikipedia.org/wiki/Web_performance
  • 5. User experience connected to the web performance
  • 6. User experience connected to the web performance from a perspec ti ve of an average user in Africa
  • 7.
  • 8. Why should you care? Africa is far.
  • 9. It is a problem for anyone: 1. Using an old device 2. Located in a rural area 3. Using an enterprise app that is hard to op ti mise
  • 10. Most web performance metrics and resources are developed with a privileged user in mind.
  • 11. For some users, the good web performance is not achievable at all.
  • 12. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device” h tt ps://www.webperf. ti ps/ ti p/cached-js-misconcep ti ons/
  • 13. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device” h tt ps://www.webperf. ti ps/ ti p/cached-js-misconcep ti ons/
  • 14. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device” h tt ps://www.webperf. ti ps/ ti p/cached-js-misconcep ti ons/
  • 15. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device” h tt ps://www.webperf. ti ps/ ti p/cached-js-misconcep ti ons/
  • 16. Latency Latency is generally considered to be the amount of ti me it takes from when a request is made by the user to the ti me it takes for the response to get back to that user. h tt ps://developer.mozilla.org/en-US/docs/Web/Performance/
  • 17. Latency in most parts of Africa is really high. High latency means long Time To First Byte (TTFB).
  • 18. Latency in most parts of Africa is really high. High latency means long Time To First Byte (TTFB).
  • 19. “While a good TTFB doesn’t necessarily mean you will have a fast website, a bad TTFB almost certainly guarantees a slow one.” — Harry Roberts h tt ps://csswizardry.com/2019/08/ ti me-to- fi rst-byte-what-it-is-and-why-it-ma tt ers/
  • 20. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device”
  • 21. Devices used “The country [Nigeria] is considered a mobile- fi rst market where infrastructure and online usage development skipped wide-ranging desktop PC adop ti on and went straight to mobile internet usage via inexpensive smartphones instead.” h tt ps://www.sta ti sta.com/sta ti s ti cs/183849/internet-users-nigeria/
  • 22. “Time spent in Parse/Compile can often be 2–5x as long on phones as on desktop.” — Addy Osmani h tt ps://medium.com/reloading/javascript-start-up-performance-69200f43b201
  • 25. How long are you willing to wait for the website to load, before you decide it is broken? Pa ti ence metric:
  • 26. If everything is slow, what can we do?
  • 27. 1. Visibility of system status “The design should always keep users informed about what is going on, through appropriate feedback within a reasonable amount of ti me.” h tt ps://www.nngroup.com/ar ti cles/ten-usability-heuris ti cs/
  • 28. 1. Visibility of system status “The design should always keep users informed about what is going on, through appropriate feedback within a reasonable amount of ti me.” h tt ps://www.nngroup.com/ar ti cles/ten-usability-heuris ti cs/
  • 29. Make sure to give user informa ti on as fast as possible: • What is going on • How long it can take • Once error occurs (and what can be done)
  • 30.
  • 31.
  • 32. Take into account digital literacy • Use simple language • Discourage damaging ac ti ons (“Do you really want to navigate out and stop the ongoing download?”) • Explain consequences of ac ti ons (for example “pull to refresh”)
  • 33. 2. Render ini ti al informa ti on ASAP Make sure there is some ini ti al content visible le tti ng user know what is going on quick.
  • 34.
  • 35.
  • 36. 3. Leverage Progressive Enhancement Make it possible to achieve the most crucial ac ti on fi rst, add extra features and fi reworks on top of that.
  • 37.
  • 38. 4. Avoid request chaining and roundtrips Consider using browser hints.
  • 39. A. Preconnect Eliminate many costly roundtrips from your request path (for example establish connec ti on with CDN used later) <link href="https://cdn.domain.com" rel="preconnect" crossorigin>
  • 40. B. Prefetch Fetch resources and store them in cache. Use for resources that might be needed for next naviga ti on. <link rel="prefetch" href="/images/big.jpeg">
  • 41. C. Preload Load late-discovered resources early. <link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin>
  • 42. 5. Lazy load resources that are not cri ti cal Don’t force user to download resources they might never discover. <img src="image.png" loading="lazy" alt=“alt text” width="200" height="200">
  • 43. 6. Op ti mise images you ship Images are usually the heaviest resources on the web.
  • 44. Op ti mise image loading • Use correct and modern formats • Use tools to op ti mise size: • h tt ps://jakearchibald.github.io/svgomg/ • h tt ps://squoosh.app/ • h tt ps://imageop ti m.com
  • 45. Op ti mise image loading • Add size / aspect ra ti o to avoid layout shifts .img-class { aspect-ratio: 16 / 9; } .img-class { width: 100px ; height: 20px ; }
  • 46. 7. Learn about network resource hints Network Informa ti on API helps web applica ti ons to access informa ti on about the user's network. navigator.connection.saveData h tt ps://developer.mozilla.org/en-US/docs/Web/API/Network_Informa ti on_API
  • 47. 8. Limit third party resources Third party resources can delay ini ti al load of the page. Load them asynchronously whenever possible. <script async src="external.js"></script> <script defer src="external.js"></script>
  • 48. 9. Test for back/forward cache If a user clicks on a naviga ti on item by mistake, it can minimise the ti me to navigate back.
  • 50. 10. Consider using Service Worker If you expect your page to be visited on regular basis, you can cache resources be tt er. h tt ps://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
  • 51. 11. Avoid crea ti ng too many layers Each layer created by the browser takes device’s resources.
  • 53. 12. Minimise website repaints While interac ti ng with the page, a lot of interac ti ve resources can force browser to repaint content.
  • 55. Summary ★ Let user know what is going on ★ Load ini ti al informa ti on early ★ Progressively enhance your website ★ Avoid request chaining and use resource hints ★ Lazy load content below the fold ★ Op ti mise images ★ Leverage Network Informa ti on API
  • 56. Summary ★ Limit third party resources (and if you need them use async loading) ★ Op ti mise for back/forward cache ★ Consider using Service Worker if applicable ★ Avoid using too many layers and repain ti ng content
  • 57. Resources • MDN: Understanding latency h tt ps://developer.mozilla.org/en-US/docs/Web/Performance/ Understanding_latency • Interac ti ve map of network speed worldwide h tt ps://www.cable.co.uk/broadband/speed/worldwide-speed- league/ • The African web ecosystem - a paper h tt ps://www.caida.org/catalog/papers/ 2018_exploring_analysing_african_web/ exploring_analysing_african_web.pdf
  • 58. Resources • web.dev: Establishing early connec ti ons with resource hints h tt ps://web.dev/preconnect-and-dns-prefetch/ • web.dev: Preloading cri ti cal assets h tt ps://web.dev/preload-cri ti cal-assets/ • web.dev: Loading third party assets h tt ps://web.dev/e ffi ciently-load-third-party-javascript/
  • 59. Resources • The psychology of web performance h tt ps://blog.uptrends.com/web-performance/the-psychology-of- web-performance/ • Designer's guide to perceived web performance h tt ps://marvelapp.com/blog/a-designers-guide-to-perceived- performance/