SlideShare a Scribd company logo
1 of 87
Please Don’t Touch the  Slow  Parts  V3.6 [email_address] http://www.ideato.it/ [email_address] http://www.cleancode.it /
Approved by  Steve Souders
 
faster
WEB faster
Faster  ==  Better ?
We have to  wait
... All the  time
“ Savings in  time feels like  simplicity ”
“ Time  is the only commodity that  matters ”
Psychology  of web performance http://www.websiteoptimization.com/speed/tweak/psychology-web-performance/ 5-8 SECONDS
Faster web, more  clicks http://www.stevesouders.com/blog/2009/07/27/wikia-fast-pages-retain-users/
Faster web, better  SEO http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html
Faster web is  hot
Say  web , Say  browser
How browsers  work
User  clicks  on a  link
Browser resolves  domain name www.google.com 72.14.234.104 DNS UDP domain
Browser  connects  to web server TCP/IP 72.14.234.104 WEB domain connect
Browser  sends  a request  for a page HTTP GET /language_tools?hl=en Host:  www.google.com domain connect send WEB
Browser  receives  a  response  with the page HTTP 200 OK domain connect send receive WEB
Browser  renders  the new  page domain connect send receive render
Rendering is  complex render
Rendering is loading resources render css img css img javascript javascript flash
Each  resource  is another web  request render
Requests  are processed in  parallel   render
Rendering is  parsing render HTML CSS DOM TREE STYLE STRUCT < html >   < head >   < title >Title</ title >   </ head >   < body >   < div >This is a Text</ div >   < div   id = &quot;hidden&quot;>Hidden</ div > body  {   padding :   0 ; } #hidden  {   display :   none ; } - document   -  elem :  html   -  elem :  head   -  elem :  title   -  text :  Title   -  elem :  body   -  elem :  div   -  text :  This is a Text   -  elem :  div   -  attr :  id=hidden   -  text :  Hidden -  selector :  body   rule :   display :  block  # default css   padding-bottom :  0px  # site css   padding-left :  0px  # site css   padding-right :  0px  # site css   padding-top :  0px  # site css -  selector :  hidden   rule :   display :  none  # site css
Rendering is  layout render DOM TREE STYLE STRUCT - document   -  elem :  html   -  elem :  head   -  elem :  title   -  text :  Title   -  elem :  body   -  elem :  div   -  text :  This is a Text   -  elem :  div   -  attr :  id=hidden   -  text :  Hidden -  selector :  body   rule :   display :  block  # default css   padding-bottom :  0px  # site css   padding-left :  0px  # site css   padding-right :  0px  # site css   padding-top :  0px  # fsite css -  selector :  hidden   rule :   display :  none  # site css - root   - body   - block   -  inline :  This is   -  inline :  a Text RENDER TREE reflow
Rendering is  painting render - root   - body   - block   -  inline :  This is   -  inline :  a Text RENDER TREE repaint This is a Text
Rendering is  execution mouse moved mouse pressed mouse released key pressed key released render INPUT OS EVENT QUEUE
Execution in  one thread mouse moved mouse pressed mouse released key pressed key released render EVENT QUEUE Javascript Execution Native Browser Action
Once upon  a time ... Few resources Static pages Less javascript
Most  time  on  server domain connect send receive render
Solution is  faster   serverside domain connect send receive render
Ajax  revolution
Ajax  revolution performance
Page updating One time (classic) WEB
On demand (ajax) WEB ... later ... Page updating
Continuous (polling) WEB Page updating
Push (comet) WEB Page updating
Most  time  on  browser domain connect send receive render
Golden rule of faster web 80%  of the end  user  response  time  is spent on the  front-end
Start there. Golden rules of faster web
Why  web slow parts ?
Easy  to  understand
Each   part  has its  rules
Which  parts   are  slow ?
Network   is   slow
Less  stuff Fewer  requests Concatenate js/css Css sprites Inline images Too many resources
Less  stuff Cache  requests Expires header Revving Files External js/css Remove etags Resources re-downloaded
Smaller  stuff Compress  responses Content-Encoding Gzip Deflate Resources are too big
Smaller  stuff Minify  responses js, css, html remove formatting remove comments optimize images use tools Resources are too big
Closer  stuff Use a  CDN Resources are too far reduce latency
Closer  stuff Flush  document  early Server can be slow Chunked encoding
Browser   is slow
Scripts block loading javascript css javascript img flash document.write location.href scripts order html img
css Put   scripts   at   bottom javascript javascript img img flash html
css Unloaded   styles block   page   rendering html img img flash
css html img img flash Put   styles   at   top
Indeed...  scripts   block everything
Load scripts  asynchronously var  scriptTag  =  document.createElement( &quot;script&quot; ) scriptTag.src  =   &quot;http://www.example.org/js/lib.js&quot; document.getElementsByTagName( &quot;head&quot; )[ 0 ] .appendChild(scriptTag)
Yield with  timers // doSomethingLong() is too slow, split it doSomething() setTimeout( function () {   doSomethingElse() },  50 )
Browser  I/O is slow
Browser  I/O is slow DOM DoG
is  alive Collections to arrays Cache values to variables DOM access triggers a live query DOM
triggers   events Event Delegation Events execute JS code DOM
Reflow   is expensive Batch  DOM changes “offline” Cloned element Document Fragment Display: none
Reflow  is expensive Batch  CSS  changes One class to rule em all Dynamic style property
Inefficient   element   location CSS are bottom-up! Be specific on the “right” #header li a direction
Inefficient   element   location Go native in DOM getElementById Xpath querySelectorAll
Rules   pitfalls
Panta rei Browserscope http://www.browserscope.org/
Expect  the  unexpected empty cache no compression
Know  your users Track user capabilities
Conflicting   rules DNS vs Parallel Inline vs External Concatenated vs Reuse
All that glitters is  not gold
Everything  is a tradeoff
performance   brings complexity
know   the   rules   but...
leave   complexity to   computers
use  libraries during  development
Use  tools at  build time http://code.google.com/speed/tools.html
Code  smart at  run time http://www.slideshare.net/ajaxexperience2009/david-wei-and-changhao-jiang-presentation Adaptive Optimization
http://abetterbrowser.org/ 9
Questions ? Rate us on joind.in http://joind.in/3364
12, 14 May - Verona www.phpday.it
27, 28 June - Florence Come and see “ don't touch the...  mobile parts “ www.bettersoftware.it

More Related Content

What's hot

jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009Ralph Whitbeck
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSSTodd Anglin
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Developmentmwrather
 
Harness jQuery Templates and Data Link
Harness jQuery Templates and Data LinkHarness jQuery Templates and Data Link
Harness jQuery Templates and Data LinkBorisMoore
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentiPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentEstelle Weyl
 
Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Holger Bartel
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Terry Ryan
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行Sofish Lin
 
UXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXUXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXStoian Dipchikov
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting languageAbhayDhupar
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaksColdFusionConference
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!Christian Heilmann
 
Brownbag on basics of web components
Brownbag on basics of web componentsBrownbag on basics of web components
Brownbag on basics of web componentsJason Park
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overviewreybango
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrMichael Enslow
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Joseph Lewis
 

What's hot (20)

jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
 
ActiveDOM
ActiveDOMActiveDOM
ActiveDOM
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSS
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
Harness jQuery Templates and Data Link
Harness jQuery Templates and Data LinkHarness jQuery Templates and Data Link
Harness jQuery Templates and Data Link
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentiPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
 
Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行
 
Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
 
UXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXUXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UX
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
JavaScript : A trending scripting language
JavaScript : A trending scripting languageJavaScript : A trending scripting language
JavaScript : A trending scripting language
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!
 
Brownbag on basics of web components
Brownbag on basics of web componentsBrownbag on basics of web components
Brownbag on basics of web components
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overview
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
 

Viewers also liked

Many to many: no man is an island
Many to many: no man is an islandMany to many: no man is an island
Many to many: no man is an islandJacopo Romei
 
fucking shit
fucking shitfucking shit
fucking shiteyalrav
 
Francesco Trucchia: Rapid Application Developement con strumenti Open Source
Francesco Trucchia: Rapid Application Developement con strumenti Open SourceFrancesco Trucchia: Rapid Application Developement con strumenti Open Source
Francesco Trucchia: Rapid Application Developement con strumenti Open SourceFrancesco Fullone
 
NCSTA 2012
NCSTA 2012NCSTA 2012
NCSTA 2012drussell
 
Help yourself, grow an healthy ecosystem
Help yourself, grow an healthy ecosystemHelp yourself, grow an healthy ecosystem
Help yourself, grow an healthy ecosystemFrancesco Fullone
 
Stefano Lanzi: PHP nella grande Azienda Pubblica – il caso della AUSL di Forlì
Stefano Lanzi: PHP nella grande Azienda Pubblica – il caso della AUSL di ForlìStefano Lanzi: PHP nella grande Azienda Pubblica – il caso della AUSL di Forlì
Stefano Lanzi: PHP nella grande Azienda Pubblica – il caso della AUSL di ForlìFrancesco Fullone
 
Calculating Percents
Calculating PercentsCalculating Percents
Calculating Percentsdrussell
 
MVP & Startup, with OpenSource Software and Microsoft Azure
MVP & Startup, with OpenSource Software and Microsoft AzureMVP & Startup, with OpenSource Software and Microsoft Azure
MVP & Startup, with OpenSource Software and Microsoft AzureFrancesco Fullone
 
NCTIES 2012
NCTIES 2012NCTIES 2012
NCTIES 2012drussell
 
NCAGT - Celebrating 40 years with 40 web 2.0 sites
NCAGT - Celebrating 40 years with 40 web 2.0 sitesNCAGT - Celebrating 40 years with 40 web 2.0 sites
NCAGT - Celebrating 40 years with 40 web 2.0 sitesdrussell
 
Un po' di ottimizzazione non fa mai male, rendere wordpress più performante
Un po' di ottimizzazione non fa mai male, rendere wordpress più performanteUn po' di ottimizzazione non fa mai male, rendere wordpress più performante
Un po' di ottimizzazione non fa mai male, rendere wordpress più performanteFrancesco Fullone
 
Quality, Courtesy and a big Parking
Quality, Courtesy and a big ParkingQuality, Courtesy and a big Parking
Quality, Courtesy and a big ParkingFrancesco Fullone
 
Spreadsheets made easy
Spreadsheets made easySpreadsheets made easy
Spreadsheets made easydrussell
 
Movie Maker
Movie MakerMovie Maker
Movie Makerdrussell
 

Viewers also liked (20)

Remote working istruzioni
Remote working istruzioniRemote working istruzioni
Remote working istruzioni
 
Many to many: no man is an island
Many to many: no man is an islandMany to many: no man is an island
Many to many: no man is an island
 
fucking shit
fucking shitfucking shit
fucking shit
 
Francesco Trucchia: Rapid Application Developement con strumenti Open Source
Francesco Trucchia: Rapid Application Developement con strumenti Open SourceFrancesco Trucchia: Rapid Application Developement con strumenti Open Source
Francesco Trucchia: Rapid Application Developement con strumenti Open Source
 
NCSTA 2012
NCSTA 2012NCSTA 2012
NCSTA 2012
 
Help yourself, grow an healthy ecosystem
Help yourself, grow an healthy ecosystemHelp yourself, grow an healthy ecosystem
Help yourself, grow an healthy ecosystem
 
Stefano Lanzi: PHP nella grande Azienda Pubblica – il caso della AUSL di Forlì
Stefano Lanzi: PHP nella grande Azienda Pubblica – il caso della AUSL di ForlìStefano Lanzi: PHP nella grande Azienda Pubblica – il caso della AUSL di Forlì
Stefano Lanzi: PHP nella grande Azienda Pubblica – il caso della AUSL di Forlì
 
Calculating Percents
Calculating PercentsCalculating Percents
Calculating Percents
 
MVP & Startup, with OpenSource Software and Microsoft Azure
MVP & Startup, with OpenSource Software and Microsoft AzureMVP & Startup, with OpenSource Software and Microsoft Azure
MVP & Startup, with OpenSource Software and Microsoft Azure
 
NCTIES 2012
NCTIES 2012NCTIES 2012
NCTIES 2012
 
NCAGT - Celebrating 40 years with 40 web 2.0 sites
NCAGT - Celebrating 40 years with 40 web 2.0 sitesNCAGT - Celebrating 40 years with 40 web 2.0 sites
NCAGT - Celebrating 40 years with 40 web 2.0 sites
 
Processing @ Javascriptcamp
Processing @ JavascriptcampProcessing @ Javascriptcamp
Processing @ Javascriptcamp
 
Compromessi e non soluzioni
Compromessi e non soluzioniCompromessi e non soluzioni
Compromessi e non soluzioni
 
math
mathmath
math
 
Un po' di ottimizzazione non fa mai male, rendere wordpress più performante
Un po' di ottimizzazione non fa mai male, rendere wordpress più performanteUn po' di ottimizzazione non fa mai male, rendere wordpress più performante
Un po' di ottimizzazione non fa mai male, rendere wordpress più performante
 
Agile == Dynamic?
Agile == Dynamic?Agile == Dynamic?
Agile == Dynamic?
 
Quality, Courtesy and a big Parking
Quality, Courtesy and a big ParkingQuality, Courtesy and a big Parking
Quality, Courtesy and a big Parking
 
Spreadsheets made easy
Spreadsheets made easySpreadsheets made easy
Spreadsheets made easy
 
Movie Maker
Movie MakerMovie Maker
Movie Maker
 
Database
DatabaseDatabase
Database
 

Similar to Please dont touch-3.6-jsday

Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3Federico Galassi
 
Web performance essentials - Goodies
Web performance essentials - GoodiesWeb performance essentials - Goodies
Web performance essentials - GoodiesJerry Emmanuel
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and RenderingStoyan Stefanov
 
Exploring Critical Rendering Path
Exploring Critical Rendering PathExploring Critical Rendering Path
Exploring Critical Rendering PathRaphael Amorim
 
Build Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićBuild Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićMeetMagentoNY2014
 
A Holistic View of Website Performance
A Holistic View of Website PerformanceA Holistic View of Website Performance
A Holistic View of Website PerformanceRene Churchill
 
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
 
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
 
Progressive downloads and rendering (Stoyan Stefanov)
Progressive downloads and rendering (Stoyan Stefanov)Progressive downloads and rendering (Stoyan Stefanov)
Progressive downloads and rendering (Stoyan Stefanov)Ontico
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp ArchitectureMorgan Cheng
 
Frontend performance
Frontend performanceFrontend performance
Frontend performancesacred 8
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tipsChris Love
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Deepak Sharma
 

Similar to Please dont touch-3.6-jsday (20)

Please dont touch-3.5
Please dont touch-3.5Please dont touch-3.5
Please dont touch-3.5
 
Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3
 
Web performance essentials - Goodies
Web performance essentials - GoodiesWeb performance essentials - Goodies
Web performance essentials - Goodies
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and Rendering
 
Exploring Critical Rendering Path
Exploring Critical Rendering PathExploring Critical Rendering Path
Exploring Critical Rendering Path
 
Build Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićBuild Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje Jurišić
 
A Holistic View of Website Performance
A Holistic View of Website PerformanceA Holistic View of Website Performance
A Holistic View of Website Performance
 
Html5 & less css
Html5 & less cssHtml5 & less css
Html5 & less css
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
 
前端概述
前端概述前端概述
前端概述
 
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
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Progressive downloads and rendering (Stoyan Stefanov)
Progressive downloads and rendering (Stoyan Stefanov)Progressive downloads and rendering (Stoyan Stefanov)
Progressive downloads and rendering (Stoyan Stefanov)
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
Speed!
Speed!Speed!
Speed!
 
SiteMesh
SiteMeshSiteMesh
SiteMesh
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp Architecture
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
 

More from Francesco Fullone

Life Cycle Design e Circular Economy: un caso reale
Life Cycle Design e Circular Economy: un caso reale Life Cycle Design e Circular Economy: un caso reale
Life Cycle Design e Circular Economy: un caso reale Francesco Fullone
 
Okr istruzioni per l'uso - devfest
Okr   istruzioni per l'uso - devfestOkr   istruzioni per l'uso - devfest
Okr istruzioni per l'uso - devfestFrancesco Fullone
 
OKR, sono veramente utili alla mia azienda?
OKR, sono veramente utili alla mia azienda?OKR, sono veramente utili alla mia azienda?
OKR, sono veramente utili alla mia azienda?Francesco Fullone
 
Open Governance, un caso reale
Open Governance, un caso realeOpen Governance, un caso reale
Open Governance, un caso realeFrancesco Fullone
 
A recommendation engine for your applications
A recommendation engine for your applicationsA recommendation engine for your applications
A recommendation engine for your applicationsFrancesco Fullone
 
A recommendation engine for your applications
A recommendation engine for your applicationsA recommendation engine for your applications
A recommendation engine for your applicationsFrancesco Fullone
 
Outsourcing, partners or suppliers?
Outsourcing, partners or suppliers?Outsourcing, partners or suppliers?
Outsourcing, partners or suppliers?Francesco Fullone
 
From brainstorming to product development
From brainstorming to product developmentFrom brainstorming to product development
From brainstorming to product developmentFrancesco Fullone
 
Compromises and not solution
Compromises and not solutionCompromises and not solution
Compromises and not solutionFrancesco Fullone
 
From webagency to...a better job, life and a lot of fun
From webagency to...a better job, life and a lot of funFrom webagency to...a better job, life and a lot of fun
From webagency to...a better job, life and a lot of funFrancesco Fullone
 
Open Source in the web enterprise world a secure success
Open Source in the web enterprise world a secure successOpen Source in the web enterprise world a secure success
Open Source in the web enterprise world a secure successFrancesco Fullone
 
Your browser, your storage (extended version)
Your browser, your storage (extended version)Your browser, your storage (extended version)
Your browser, your storage (extended version)Francesco Fullone
 

More from Francesco Fullone (20)

Life Cycle Design e Circular Economy: un caso reale
Life Cycle Design e Circular Economy: un caso reale Life Cycle Design e Circular Economy: un caso reale
Life Cycle Design e Circular Economy: un caso reale
 
Okr istruzioni per l'uso - devfest
Okr   istruzioni per l'uso - devfestOkr   istruzioni per l'uso - devfest
Okr istruzioni per l'uso - devfest
 
OKR, sono veramente utili alla mia azienda?
OKR, sono veramente utili alla mia azienda?OKR, sono veramente utili alla mia azienda?
OKR, sono veramente utili alla mia azienda?
 
Okr per community - icms
Okr   per community - icmsOkr   per community - icms
Okr per community - icms
 
Open Governance, un caso reale
Open Governance, un caso realeOpen Governance, un caso reale
Open Governance, un caso reale
 
A recommendation engine for your applications
A recommendation engine for your applicationsA recommendation engine for your applications
A recommendation engine for your applications
 
A recommendation engine for your applications
A recommendation engine for your applicationsA recommendation engine for your applications
A recommendation engine for your applications
 
Con te non ci lavoro
Con te non ci lavoroCon te non ci lavoro
Con te non ci lavoro
 
Con te non ci lavoro
Con te non ci lavoroCon te non ci lavoro
Con te non ci lavoro
 
Continuous budgeting
Continuous budgetingContinuous budgeting
Continuous budgeting
 
Remote working istruzioni
Remote working istruzioniRemote working istruzioni
Remote working istruzioni
 
Remote working istruzioni
Remote working istruzioniRemote working istruzioni
Remote working istruzioni
 
Outsourcing, partners or suppliers?
Outsourcing, partners or suppliers?Outsourcing, partners or suppliers?
Outsourcing, partners or suppliers?
 
From brainstorming to product development
From brainstorming to product developmentFrom brainstorming to product development
From brainstorming to product development
 
Compromises and not solution
Compromises and not solutionCompromises and not solution
Compromises and not solution
 
PHP Goes Enterprise
PHP Goes EnterprisePHP Goes Enterprise
PHP Goes Enterprise
 
your browser, my storage
your browser, my storageyour browser, my storage
your browser, my storage
 
From webagency to...a better job, life and a lot of fun
From webagency to...a better job, life and a lot of funFrom webagency to...a better job, life and a lot of fun
From webagency to...a better job, life and a lot of fun
 
Open Source in the web enterprise world a secure success
Open Source in the web enterprise world a secure successOpen Source in the web enterprise world a secure success
Open Source in the web enterprise world a secure success
 
Your browser, your storage (extended version)
Your browser, your storage (extended version)Your browser, your storage (extended version)
Your browser, your storage (extended version)
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
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
 
"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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
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!
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
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
 
"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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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)
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Please dont touch-3.6-jsday

  • 1. Please Don’t Touch the Slow Parts V3.6 [email_address] http://www.ideato.it/ [email_address] http://www.cleancode.it /
  • 2. Approved by Steve Souders
  • 3.  
  • 6. Faster == Better ?
  • 7. We have to wait
  • 8. ... All the time
  • 9. “ Savings in time feels like simplicity ”
  • 10. “ Time is the only commodity that matters ”
  • 11. Psychology of web performance http://www.websiteoptimization.com/speed/tweak/psychology-web-performance/ 5-8 SECONDS
  • 12. Faster web, more clicks http://www.stevesouders.com/blog/2009/07/27/wikia-fast-pages-retain-users/
  • 13. Faster web, better SEO http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html
  • 15. Say web , Say browser
  • 16. How browsers work
  • 17. User clicks on a link
  • 18. Browser resolves domain name www.google.com 72.14.234.104 DNS UDP domain
  • 19. Browser connects to web server TCP/IP 72.14.234.104 WEB domain connect
  • 20. Browser sends a request for a page HTTP GET /language_tools?hl=en Host: www.google.com domain connect send WEB
  • 21. Browser receives a response with the page HTTP 200 OK domain connect send receive WEB
  • 22. Browser renders the new page domain connect send receive render
  • 23. Rendering is complex render
  • 24. Rendering is loading resources render css img css img javascript javascript flash
  • 25. Each resource is another web request render
  • 26. Requests are processed in parallel render
  • 27. Rendering is parsing render HTML CSS DOM TREE STYLE STRUCT < html > < head > < title >Title</ title > </ head > < body > < div >This is a Text</ div > < div id = &quot;hidden&quot;>Hidden</ div > body { padding : 0 ; } #hidden { display : none ; } - document - elem : html - elem : head - elem : title - text : Title - elem : body - elem : div - text : This is a Text - elem : div - attr : id=hidden - text : Hidden - selector : body rule : display : block # default css padding-bottom : 0px # site css padding-left : 0px # site css padding-right : 0px # site css padding-top : 0px # site css - selector : hidden rule : display : none # site css
  • 28. Rendering is layout render DOM TREE STYLE STRUCT - document - elem : html - elem : head - elem : title - text : Title - elem : body - elem : div - text : This is a Text - elem : div - attr : id=hidden - text : Hidden - selector : body rule : display : block # default css padding-bottom : 0px # site css padding-left : 0px # site css padding-right : 0px # site css padding-top : 0px # fsite css - selector : hidden rule : display : none # site css - root - body - block - inline : This is - inline : a Text RENDER TREE reflow
  • 29. Rendering is painting render - root - body - block - inline : This is - inline : a Text RENDER TREE repaint This is a Text
  • 30. Rendering is execution mouse moved mouse pressed mouse released key pressed key released render INPUT OS EVENT QUEUE
  • 31. Execution in one thread mouse moved mouse pressed mouse released key pressed key released render EVENT QUEUE Javascript Execution Native Browser Action
  • 32. Once upon a time ... Few resources Static pages Less javascript
  • 33. Most time on server domain connect send receive render
  • 34. Solution is faster serverside domain connect send receive render
  • 36. Ajax revolution performance
  • 37. Page updating One time (classic) WEB
  • 38. On demand (ajax) WEB ... later ... Page updating
  • 39. Continuous (polling) WEB Page updating
  • 40. Push (comet) WEB Page updating
  • 41. Most time on browser domain connect send receive render
  • 42. Golden rule of faster web 80% of the end user response time is spent on the front-end
  • 43. Start there. Golden rules of faster web
  • 44. Why web slow parts ?
  • 45. Easy to understand
  • 46. Each part has its rules
  • 47. Which parts are slow ?
  • 48. Network is slow
  • 49. Less stuff Fewer requests Concatenate js/css Css sprites Inline images Too many resources
  • 50. Less stuff Cache requests Expires header Revving Files External js/css Remove etags Resources re-downloaded
  • 51. Smaller stuff Compress responses Content-Encoding Gzip Deflate Resources are too big
  • 52. Smaller stuff Minify responses js, css, html remove formatting remove comments optimize images use tools Resources are too big
  • 53. Closer stuff Use a CDN Resources are too far reduce latency
  • 54. Closer stuff Flush document early Server can be slow Chunked encoding
  • 55. Browser is slow
  • 56. Scripts block loading javascript css javascript img flash document.write location.href scripts order html img
  • 57. css Put scripts at bottom javascript javascript img img flash html
  • 58. css Unloaded styles block page rendering html img img flash
  • 59. css html img img flash Put styles at top
  • 60. Indeed... scripts block everything
  • 61. Load scripts asynchronously var scriptTag = document.createElement( &quot;script&quot; ) scriptTag.src = &quot;http://www.example.org/js/lib.js&quot; document.getElementsByTagName( &quot;head&quot; )[ 0 ] .appendChild(scriptTag)
  • 62. Yield with timers // doSomethingLong() is too slow, split it doSomething() setTimeout( function () { doSomethingElse() }, 50 )
  • 63. Browser I/O is slow
  • 64. Browser I/O is slow DOM DoG
  • 65. is alive Collections to arrays Cache values to variables DOM access triggers a live query DOM
  • 66. triggers events Event Delegation Events execute JS code DOM
  • 67. Reflow is expensive Batch DOM changes “offline” Cloned element Document Fragment Display: none
  • 68. Reflow is expensive Batch CSS changes One class to rule em all Dynamic style property
  • 69. Inefficient element location CSS are bottom-up! Be specific on the “right” #header li a direction
  • 70. Inefficient element location Go native in DOM getElementById Xpath querySelectorAll
  • 71. Rules pitfalls
  • 72. Panta rei Browserscope http://www.browserscope.org/
  • 73. Expect the unexpected empty cache no compression
  • 74. Know your users Track user capabilities
  • 75. Conflicting rules DNS vs Parallel Inline vs External Concatenated vs Reuse
  • 76. All that glitters is not gold
  • 77. Everything is a tradeoff
  • 78. performance brings complexity
  • 79. know the rules but...
  • 80. leave complexity to computers
  • 81. use libraries during development
  • 82. Use tools at build time http://code.google.com/speed/tools.html
  • 83. Code smart at run time http://www.slideshare.net/ajaxexperience2009/david-wei-and-changhao-jiang-presentation Adaptive Optimization
  • 85. Questions ? Rate us on joind.in http://joind.in/3364
  • 86. 12, 14 May - Verona www.phpday.it
  • 87. 27, 28 June - Florence Come and see “ don't touch the... mobile parts “ www.bettersoftware.it