SlideShare a Scribd company logo
Tech Meetup: Web Applications Performance
Welcome!
Moderators:
● Mariano Brolio
● Ramiro Castro
Tech Meetup: Web Applications Performance
Why bother?
● Better user experience
● Higher visitor engagement
● Retention
● Conversions
● Productivity
● Hardware efficiency
● ROI
Tech Meetup: Web Applications Performance
Web Applications Performance
Back-end vs. Front-end
The Golden Performance Rule:
80-90% of the end-user response time is spent on the frontend
Tech Meetup: Web Applications Performance
What to optimize:
Back-end:
● PHP Opcode
● Memory object cache
● Reverse cache
● Web server
● Database
● Architecture
Front-end:
● Cache
● ▿ Round-trip times
● ▿ Request overhead
● ▿ Payload size
● Rendering performance
● Javascript performance
● Perception of speed
Tech Meetup: Web Applications Performance
What is PHP Opcode cache?
● Performance Enhancing Extensions for PHP.
● Caches a compiled version of PHP script (bytecode) in
memory.
● Inject cache into the PHP life-cycle.
● Average 100% speed increase with default settings.
● Reduce file system I/O overhead.
Tech Meetup: Web Applications Performance
PHP Opcode
Extensions
● APC
● xCache
● Zend OPcache
● Microsoft WinCache
Tech Meetup: Web Applications Performance
Memory Object Cache
● Memcached
Memcached is an in-memory key-value store for small chunks of arbitrary
data (strings, objects) from results of database calls, API calls, or page
rendering.
● APC
● Redis
Tech Meetup: Web Applications Performance
Memory Object Cache
What to cache:
● Database results
● Config variables
● Rendered templates
● Processed data
● Web services responses
Tech Meetup: Web Applications Performance
Reverse Cache
● Varnish
● Nginx
● Squid
Web
Server
Web
Server
Web
Server
DB Server DB Server
Memcached / Redis
Varnish
Tech Meetup: Web Applications Performance
Server side compression
● Google PageSpeed module
● Apache
○ mod_deflate
● Nginx
○ HttpGzipModule
● IIS
○ Configure HTTP compression
Tech Meetup: Web Applications Performance
PHP Performance Tips
● Profile your code to pinpoint
bottlenecks
● Upgrade your version of PHP
● Use caching
● Use output buffering
● Avoid doing SQL queries within a
loop
● Use queues to avoid unnecessary
waits
● Prefer “foreach” loops
● Calculate loop length in advance
● Other micro-optimizations to
discuss
“Premature optimization is the root of all evil”. Donald Knuth
Tech Meetup: Web Applications Performance
MySQL Performance
● InnoDB vs. MyISAM
● Log slow queries
[mysqld]
log-slow-queries = /var/log/mysql/mysqld-
slow.log
long_query_time=1
● Analyze slow queries
EXPLAIN SELECT ...
● mytop
● Iterative Optimization by
Benchmarking
● Optimize Schema
○ Simple data types
○ Avoid NULL
○ Too many columns / joins
● Indexing
● Fetching more rows than needed
● Fetching all columns from a multi-
table join
● * is evil
● MySQL in the cloud
Tech Meetup: Web Applications Performance
Architecture Design
Just to mention a few:
● DNS Round Robin
● Load-balanced architecture
● HipHop Virtual Machine
● Database sharding
● Queues
Tech Meetup: Web Applications Performance
Performance in the Front-end
● Optimize Caching
● Minimize Round-Trip Times
● Minimize Request overhead
● Minimize Payload size
● Optimize Rendering
● asynchronous != instantaneous
Tech Meetup: Web Applications Performance
Optimize Caching
● Configure web server for caching
static resources
○ Set far future Expires header
○ Set Cache-Control
○ Configure ETags
● Set caching headers aggressively
for all static resources
● Cache redirections
● Use fingerprinting to dynamically
enable caching.
● Don't include a query string in the
URL for static resources.
● Don't enable proxy caching for
resources that set cookies.
● Be aware of issues with proxy
caching of JS and CSS files.
Tech Meetup: Web Applications Performance
Cache headers example
Request: Response:
Accept-Encoding:gzip,deflate,sdch Content-Encoding: gzip
Cache-Control: max-age=0 Cache-Control: public | private, no-cache, no-
store, must-revalidate
Expires:Mon, 16 Mar 2015 00:07:51 GMT
If-None-Match:
eb3878bf2bb06c1e33f1b09b285d13e0
ETag:eb3878bf2bb06c1e33f1b09b285d13e0
Connection:keep-alive Connection:Keep-Alive
Keep-Alive:timeout=5, max=100
If-Modified-Since: Mon, 16 Mar 2015 00:07:51
GMT
Last-Modified: Mon, 16 Mar 2015 00:07:51 GMT
Tech Meetup: Web Applications Performance
Minimize round-trip times
● Use a CDN for static content
● Minimize DNS lookups
● Minimize redirects
● Avoid bad requests
● Combine JS files
● Combine CSS files
● Combine images using sprites
● Use inline images when needed:
○ data: URL scheme
● Use image maps when possible
● Use font icons if available
● Put external scripts after external
stylesheets if possible.
● Put inline scripts after other
resources if possible.
● Avoid document.write
● Prefer async resources
○ async HTML5 attribute
Tech Meetup: Web Applications Performance
Minimize request overhead
● Don’t store large amounts of data
on cookies
● Serve static content from a
cookie-less domain
● Use server-side storage for most
of the cookie payload
● Remove unused or duplicated
cookie fields
Tech Meetup: Web Applications Performance
Minimize Payload Size
● Optimize Images
○ Use an appropriate file format
○ Use an image compressor
● Serve scaled version of images
● Defer loading of resources not
used on startup
● Enable Compression
○ Write your web page content to make
compression most effective
● Minify Javascript
● Minify CSS
○ Remove unused CSS
● Minify HTML
○ Omit optional HTML tags/attrib.
Tech Meetup: Web Applications Performance
Optimize browser rendering
● Apply animations with position fixed or
absolute
● Add/remove classes not styles
● Specify image dimensions
○ that match those of the images on the
img element or block-level parent
● Specify a character set
○ Always specify a content type and
correct character encoding.
● Reduce number of DOM elems.
● Batch DOM changes
● Stay away from table layouts
● Put CSS in the document head
● Use efficient CSS selectors
○ Avoid a universal key selector
○ Make your rules as specific as
possible.
○ Remove redundant qualifiers.
○ Use class selectors instead of
descendant selectors.
● Avoid CSS expressions
● Avoid reflows:
○ Change CSS classes as low in the
DOM as possible
Tech Meetup: Web Applications Performance
Optimize jQuery
● Use $(window).load( ) instead of
$(document).ready( ) when
possible.
● Use object detection even if
jQuery doesn't throw an error
● Use direct functions rather than
their convenience counterparts
● Avoid using jquery in loops
● Cache jQuery objects: $id =
$(‘#id’)
● Chain instead of repeat
● Always descend from an id:
$(‘#id’).find( )
● Use (HTML5) tags before classes
$(‘p’)
● Always prefix a class with a tag
name
● Avoid using general selectors
Tech Meetup: Web Applications Performance
Optimize JavaScript
● Use strict mode: “use strict”;
● Use window.performance
● Listen for events lower in the
DOM
● Bind multiple events at once
● Remember to unbind events when
they are no longer needed
● Avoid unnecessary closures
● Avoid creating functions
unnecessarily
● Cache references
● Cache AJAX results in an variable
● Store references to elements
deep in arrays when calling
multiple times.
● Use Local variables
● Batch DOM changes
Tech Meetup: Web Applications Performance
Tools
Analysis Tools
● Chrome Dev Tools
● Firebug
● YSlow extension
● PageSpeed Insights / extension
● Web Page Test
● Apache Benchmark
Compression Tools
● YUI Compressor
● Closure Compiler
● JSmin
● SpriteMe
● Smush.it
Tech Meetup: Web Applications Performance
Chrome Dev Tools
Tech Meetup: Web Applications Performance
Firebug
Tech Meetup: Web Applications Performance
Perception of speed
● The 100ms rule:
“No single JavaScript job should execute for more than 100ms to ensure a
responsive UI”
● Ensure a fast response
● Keep the user busy on waits
● Use progress bar indicators
● Staring at a blank page is not a good user experience
● Quickly show the skeleton of the screen
Tech Meetup: Web Applications Performance
Thanks!

More Related Content

What's hot

Drupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developers
nuppla
 
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
Ortus Solutions, Corp
 
Lean and mean MongoDB
Lean and mean MongoDBLean and mean MongoDB
Lean and mean MongoDB
Oleg Podsechin
 
Html5-Web-Storage
Html5-Web-StorageHtml5-Web-Storage
Html5-Web-Storage
Mindfire Solutions
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
Krishnaprasad k
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
Falcon2018
 
Pump up the JAM with Gatsby (2019)
Pump up the JAM with Gatsby (2019)Pump up the JAM with Gatsby (2019)
Pump up the JAM with Gatsby (2019)
Stefan Adolf
 
Taming 3rd party content
Taming 3rd party contentTaming 3rd party content
Taming 3rd party content
SergeyChernyshev
 
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
David Amend
 
Tool it Up! - Session #2 - NetPanel
Tool it Up! - Session #2 - NetPanelTool it Up! - Session #2 - NetPanel
Tool it Up! - Session #2 - NetPanel
toolitup
 
WDML design
WDML designWDML design
WDML design
jomarweb
 
Client Side rendering Not so Easy
Client Side rendering Not so EasyClient Side rendering Not so Easy
Client Side rendering Not so Easy
nuria_ruiz
 
Scalable server component using NodeJS & ExpressJS
Scalable server component using NodeJS & ExpressJSScalable server component using NodeJS & ExpressJS
Scalable server component using NodeJS & ExpressJS
Andhy Koesnandar
 
Web without framework
Web without frameworkWeb without framework
Web without framework
Nicolas Jorand
 
Visualize your graph database
Visualize your graph databaseVisualize your graph database
Visualize your graph database
Michael Hackstein
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013
Andy Bunce
 
Starting with MongoDB
Starting with MongoDBStarting with MongoDB
Starting with MongoDB
Cesar Martinez
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
Chen-Tien Tsai
 
003. ReactJS basic
003. ReactJS basic003. ReactJS basic
003. ReactJS basic
Binh Quan Duc
 
Cloud arch patterns
Cloud arch patternsCloud arch patterns
Cloud arch patterns
Corey Huinker
 

What's hot (20)

Drupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developers
 
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
 
Lean and mean MongoDB
Lean and mean MongoDBLean and mean MongoDB
Lean and mean MongoDB
 
Html5-Web-Storage
Html5-Web-StorageHtml5-Web-Storage
Html5-Web-Storage
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
Pump up the JAM with Gatsby (2019)
Pump up the JAM with Gatsby (2019)Pump up the JAM with Gatsby (2019)
Pump up the JAM with Gatsby (2019)
 
Taming 3rd party content
Taming 3rd party contentTaming 3rd party content
Taming 3rd party content
 
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
 
Tool it Up! - Session #2 - NetPanel
Tool it Up! - Session #2 - NetPanelTool it Up! - Session #2 - NetPanel
Tool it Up! - Session #2 - NetPanel
 
WDML design
WDML designWDML design
WDML design
 
Client Side rendering Not so Easy
Client Side rendering Not so EasyClient Side rendering Not so Easy
Client Side rendering Not so Easy
 
Scalable server component using NodeJS & ExpressJS
Scalable server component using NodeJS & ExpressJSScalable server component using NodeJS & ExpressJS
Scalable server component using NodeJS & ExpressJS
 
Web without framework
Web without frameworkWeb without framework
Web without framework
 
Visualize your graph database
Visualize your graph databaseVisualize your graph database
Visualize your graph database
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013
 
Starting with MongoDB
Starting with MongoDBStarting with MongoDB
Starting with MongoDB
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
003. ReactJS basic
003. ReactJS basic003. ReactJS basic
003. ReactJS basic
 
Cloud arch patterns
Cloud arch patternsCloud arch patterns
Cloud arch patterns
 

Viewers also liked

ภาษาอังกฤษ
ภาษาอังกฤษภาษาอังกฤษ
ภาษาอังกฤษChalermraj Kaewyot
 
ข้อสอบ O net ศิลปะ ม.6 ชุด 1
ข้อสอบ O net ศิลปะ ม.6 ชุด 1ข้อสอบ O net ศิลปะ ม.6 ชุด 1
ข้อสอบ O net ศิลปะ ม.6 ชุด 1cookie47
 
Hr2015
Hr2015Hr2015
Portfolio
PortfolioPortfolio
Portfolio
carlaclancy
 
Christian Schuit
Christian SchuitChristian Schuit
Christian Schuit
Software AG South Africa
 
ใบงานที่2
ใบงานที่2ใบงานที่2
ใบงานที่2warangnan
 
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
Plew Woo
 
али1
али1али1
али1
Murat77
 
Interpretación geométrica de la derivada
Interpretación geométrica de la derivadaInterpretación geométrica de la derivada
Interpretación geométrica de la derivada
Pablo Jesus Contreras Muñoz
 
Presentasi yang effektif
Presentasi yang effektifPresentasi yang effektif
Presentasi yang effektif
ayatbima
 
職業デザインセンター0114
職業デザインセンター0114職業デザインセンター0114
職業デザインセンター0114
Takahiro Inoue
 
Aula 03
Aula 03Aula 03
Aula 03
Daiane Mmn
 
изменения
измененияизменения
изменения
Murat77
 
ใบงานที่7
ใบงานที่7ใบงานที่7
ใบงานที่7warangnan
 
ASTM A335 CHROME MOLY PIPE
ASTM A335 CHROME MOLY PIPEASTM A335 CHROME MOLY PIPE
ASTM A335 CHROME MOLY PIPE
Sunny Steel Enterpirse Ltd.
 
устав
уставустав
устав
Murat77
 
ข้อสอบ O net ภาษาต่างประเทศ ม.6 ชุด 1
ข้อสอบ O net ภาษาต่างประเทศ ม.6 ชุด 1ข้อสอบ O net ภาษาต่างประเทศ ม.6 ชุด 1
ข้อสอบ O net ภาษาต่างประเทศ ม.6 ชุด 1cookie47
 
ものすごくキレイにNexus 7に スクリーンプロテクターを貼る方法
ものすごくキレイにNexus 7にスクリーンプロテクターを貼る方法ものすごくキレイにNexus 7にスクリーンプロテクターを貼る方法
ものすごくキレイにNexus 7に スクリーンプロテクターを貼る方法
DREAMHIVE CO., LTD.
 

Viewers also liked (20)

Letter
LetterLetter
Letter
 
ภาษาอังกฤษ
ภาษาอังกฤษภาษาอังกฤษ
ภาษาอังกฤษ
 
функция
функцияфункция
функция
 
ข้อสอบ O net ศิลปะ ม.6 ชุด 1
ข้อสอบ O net ศิลปะ ม.6 ชุด 1ข้อสอบ O net ศิลปะ ม.6 ชุด 1
ข้อสอบ O net ศิลปะ ม.6 ชุด 1
 
Hr2015
Hr2015Hr2015
Hr2015
 
Portfolio
PortfolioPortfolio
Portfolio
 
Christian Schuit
Christian SchuitChristian Schuit
Christian Schuit
 
ใบงานที่2
ใบงานที่2ใบงานที่2
ใบงานที่2
 
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
 
али1
али1али1
али1
 
Interpretación geométrica de la derivada
Interpretación geométrica de la derivadaInterpretación geométrica de la derivada
Interpretación geométrica de la derivada
 
Presentasi yang effektif
Presentasi yang effektifPresentasi yang effektif
Presentasi yang effektif
 
職業デザインセンター0114
職業デザインセンター0114職業デザインセンター0114
職業デザインセンター0114
 
Aula 03
Aula 03Aula 03
Aula 03
 
изменения
измененияизменения
изменения
 
ใบงานที่7
ใบงานที่7ใบงานที่7
ใบงานที่7
 
ASTM A335 CHROME MOLY PIPE
ASTM A335 CHROME MOLY PIPEASTM A335 CHROME MOLY PIPE
ASTM A335 CHROME MOLY PIPE
 
устав
уставустав
устав
 
ข้อสอบ O net ภาษาต่างประเทศ ม.6 ชุด 1
ข้อสอบ O net ภาษาต่างประเทศ ม.6 ชุด 1ข้อสอบ O net ภาษาต่างประเทศ ม.6 ชุด 1
ข้อสอบ O net ภาษาต่างประเทศ ม.6 ชุด 1
 
ものすごくキレイにNexus 7に スクリーンプロテクターを貼る方法
ものすごくキレイにNexus 7にスクリーンプロテクターを貼る方法ものすごくキレイにNexus 7にスクリーンプロテクターを貼る方法
ものすごくキレイにNexus 7に スクリーンプロテクターを貼る方法
 

Similar to Tech meetup: Web Applications Performance

Architektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan KrausArchitektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan Kraus
Women in Technology Poland
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
Dmytro Semenov
 
Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)
Ontico
 
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan KrausHTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
Women in Technology Poland
 
Parallel programing in web applications - public.pptx
Parallel programing in web applications - public.pptxParallel programing in web applications - public.pptx
Parallel programing in web applications - public.pptx
Guy Bary
 
Journey through high performance django application
Journey through high performance django applicationJourney through high performance django application
Journey through high performance django application
bangaloredjangousergroup
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
Alive Kuo
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
Krivoy Rog IT Community
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
Andrew Siemer
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013
Santiago Aimetta
 
Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)
rc2209
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre
Pablo Moretti
 
18_Node.js.ppt
18_Node.js.ppt18_Node.js.ppt
18_Node.js.ppt
KhalilSalhi7
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGears
Alessandro Molina
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applications
BrettTasker
 
Revealing ALLSTOCKER
Revealing ALLSTOCKERRevealing ALLSTOCKER
Revealing ALLSTOCKER
Masashi Umezawa
 
18_Node.js.ppt
18_Node.js.ppt18_Node.js.ppt
18_Node.js.ppt
MaulikShah516542
 
NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1
eddify
 
Drupal 7 performance and optimization
Drupal 7 performance and optimizationDrupal 7 performance and optimization
Drupal 7 performance and optimization
Shafqat Hussain
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend Performance
Thomas Weinert
 

Similar to Tech meetup: Web Applications Performance (20)

Architektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan KrausArchitektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan Kraus
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)
 
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan KrausHTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
 
Parallel programing in web applications - public.pptx
Parallel programing in web applications - public.pptxParallel programing in web applications - public.pptx
Parallel programing in web applications - public.pptx
 
Journey through high performance django application
Journey through high performance django applicationJourney through high performance django application
Journey through high performance django application
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013
 
Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre
 
18_Node.js.ppt
18_Node.js.ppt18_Node.js.ppt
18_Node.js.ppt
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGears
 
Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applications
 
Revealing ALLSTOCKER
Revealing ALLSTOCKERRevealing ALLSTOCKER
Revealing ALLSTOCKER
 
18_Node.js.ppt
18_Node.js.ppt18_Node.js.ppt
18_Node.js.ppt
 
NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1
 
Drupal 7 performance and optimization
Drupal 7 performance and optimizationDrupal 7 performance and optimization
Drupal 7 performance and optimization
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend Performance
 

More from Santex Group

Entender React Native
Entender React NativeEntender React Native
Entender React Native
Santex Group
 
Server side development using Swift and Vapor
Server side development using Swift and VaporServer side development using Swift and Vapor
Server side development using Swift and Vapor
Santex Group
 
Tech Meetup: Jenkins, the moody buttler
Tech Meetup: Jenkins, the moody buttlerTech Meetup: Jenkins, the moody buttler
Tech Meetup: Jenkins, the moody buttler
Santex Group
 
Tech Meetup: Be reactive with Android
Tech Meetup: Be reactive with AndroidTech Meetup: Be reactive with Android
Tech Meetup: Be reactive with Android
Santex Group
 
Tech Meetup: How to solve 2 common problems in Android & iOS
Tech Meetup: How to solve 2 common problems in Android & iOSTech Meetup: How to solve 2 common problems in Android & iOS
Tech Meetup: How to solve 2 common problems in Android & iOS
Santex Group
 
Tech Meetup: Gamificar con Agilidad
Tech Meetup: Gamificar con AgilidadTech Meetup: Gamificar con Agilidad
Tech Meetup: Gamificar con Agilidad
Santex Group
 
Tech Meetup: How to build a Rest API in Java
Tech Meetup: How to build a Rest API in JavaTech Meetup: How to build a Rest API in Java
Tech Meetup: How to build a Rest API in Java
Santex Group
 
TECH MEETUP - From the groud up with GIT
TECH MEETUP - From the groud up with GITTECH MEETUP - From the groud up with GIT
TECH MEETUP - From the groud up with GIT
Santex Group
 
Tech MeetUp: Agile Methodologies in eCommerce
Tech MeetUp: Agile Methodologies in eCommerceTech MeetUp: Agile Methodologies in eCommerce
Tech MeetUp: Agile Methodologies in eCommerce
Santex Group
 
Meetup: Mobile Automation
Meetup: Mobile AutomationMeetup: Mobile Automation
Meetup: Mobile Automation
Santex Group
 
User Stories Do's and Dont's
User Stories Do's and Dont'sUser Stories Do's and Dont's
User Stories Do's and Dont's
Santex Group
 
E commerce done the right way: Magento!
E commerce done the right way: Magento!E commerce done the right way: Magento!
E commerce done the right way: Magento!
Santex Group
 
Tech Meetup - Agile testing vs Testing in Agile
Tech Meetup - Agile testing vs Testing in AgileTech Meetup - Agile testing vs Testing in Agile
Tech Meetup - Agile testing vs Testing in Agile
Santex Group
 

More from Santex Group (13)

Entender React Native
Entender React NativeEntender React Native
Entender React Native
 
Server side development using Swift and Vapor
Server side development using Swift and VaporServer side development using Swift and Vapor
Server side development using Swift and Vapor
 
Tech Meetup: Jenkins, the moody buttler
Tech Meetup: Jenkins, the moody buttlerTech Meetup: Jenkins, the moody buttler
Tech Meetup: Jenkins, the moody buttler
 
Tech Meetup: Be reactive with Android
Tech Meetup: Be reactive with AndroidTech Meetup: Be reactive with Android
Tech Meetup: Be reactive with Android
 
Tech Meetup: How to solve 2 common problems in Android & iOS
Tech Meetup: How to solve 2 common problems in Android & iOSTech Meetup: How to solve 2 common problems in Android & iOS
Tech Meetup: How to solve 2 common problems in Android & iOS
 
Tech Meetup: Gamificar con Agilidad
Tech Meetup: Gamificar con AgilidadTech Meetup: Gamificar con Agilidad
Tech Meetup: Gamificar con Agilidad
 
Tech Meetup: How to build a Rest API in Java
Tech Meetup: How to build a Rest API in JavaTech Meetup: How to build a Rest API in Java
Tech Meetup: How to build a Rest API in Java
 
TECH MEETUP - From the groud up with GIT
TECH MEETUP - From the groud up with GITTECH MEETUP - From the groud up with GIT
TECH MEETUP - From the groud up with GIT
 
Tech MeetUp: Agile Methodologies in eCommerce
Tech MeetUp: Agile Methodologies in eCommerceTech MeetUp: Agile Methodologies in eCommerce
Tech MeetUp: Agile Methodologies in eCommerce
 
Meetup: Mobile Automation
Meetup: Mobile AutomationMeetup: Mobile Automation
Meetup: Mobile Automation
 
User Stories Do's and Dont's
User Stories Do's and Dont'sUser Stories Do's and Dont's
User Stories Do's and Dont's
 
E commerce done the right way: Magento!
E commerce done the right way: Magento!E commerce done the right way: Magento!
E commerce done the right way: Magento!
 
Tech Meetup - Agile testing vs Testing in Agile
Tech Meetup - Agile testing vs Testing in AgileTech Meetup - Agile testing vs Testing in Agile
Tech Meetup - Agile testing vs Testing in Agile
 

Recently uploaded

Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 

Recently uploaded (20)

Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 

Tech meetup: Web Applications Performance

  • 1. Tech Meetup: Web Applications Performance Welcome! Moderators: ● Mariano Brolio ● Ramiro Castro
  • 2. Tech Meetup: Web Applications Performance Why bother? ● Better user experience ● Higher visitor engagement ● Retention ● Conversions ● Productivity ● Hardware efficiency ● ROI
  • 3. Tech Meetup: Web Applications Performance Web Applications Performance Back-end vs. Front-end The Golden Performance Rule: 80-90% of the end-user response time is spent on the frontend
  • 4. Tech Meetup: Web Applications Performance What to optimize: Back-end: ● PHP Opcode ● Memory object cache ● Reverse cache ● Web server ● Database ● Architecture Front-end: ● Cache ● ▿ Round-trip times ● ▿ Request overhead ● ▿ Payload size ● Rendering performance ● Javascript performance ● Perception of speed
  • 5. Tech Meetup: Web Applications Performance What is PHP Opcode cache? ● Performance Enhancing Extensions for PHP. ● Caches a compiled version of PHP script (bytecode) in memory. ● Inject cache into the PHP life-cycle. ● Average 100% speed increase with default settings. ● Reduce file system I/O overhead.
  • 6. Tech Meetup: Web Applications Performance PHP Opcode Extensions ● APC ● xCache ● Zend OPcache ● Microsoft WinCache
  • 7. Tech Meetup: Web Applications Performance Memory Object Cache ● Memcached Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. ● APC ● Redis
  • 8. Tech Meetup: Web Applications Performance Memory Object Cache What to cache: ● Database results ● Config variables ● Rendered templates ● Processed data ● Web services responses
  • 9. Tech Meetup: Web Applications Performance Reverse Cache ● Varnish ● Nginx ● Squid Web Server Web Server Web Server DB Server DB Server Memcached / Redis Varnish
  • 10. Tech Meetup: Web Applications Performance Server side compression ● Google PageSpeed module ● Apache ○ mod_deflate ● Nginx ○ HttpGzipModule ● IIS ○ Configure HTTP compression
  • 11. Tech Meetup: Web Applications Performance PHP Performance Tips ● Profile your code to pinpoint bottlenecks ● Upgrade your version of PHP ● Use caching ● Use output buffering ● Avoid doing SQL queries within a loop ● Use queues to avoid unnecessary waits ● Prefer “foreach” loops ● Calculate loop length in advance ● Other micro-optimizations to discuss “Premature optimization is the root of all evil”. Donald Knuth
  • 12. Tech Meetup: Web Applications Performance MySQL Performance ● InnoDB vs. MyISAM ● Log slow queries [mysqld] log-slow-queries = /var/log/mysql/mysqld- slow.log long_query_time=1 ● Analyze slow queries EXPLAIN SELECT ... ● mytop ● Iterative Optimization by Benchmarking ● Optimize Schema ○ Simple data types ○ Avoid NULL ○ Too many columns / joins ● Indexing ● Fetching more rows than needed ● Fetching all columns from a multi- table join ● * is evil ● MySQL in the cloud
  • 13. Tech Meetup: Web Applications Performance Architecture Design Just to mention a few: ● DNS Round Robin ● Load-balanced architecture ● HipHop Virtual Machine ● Database sharding ● Queues
  • 14. Tech Meetup: Web Applications Performance Performance in the Front-end ● Optimize Caching ● Minimize Round-Trip Times ● Minimize Request overhead ● Minimize Payload size ● Optimize Rendering ● asynchronous != instantaneous
  • 15. Tech Meetup: Web Applications Performance Optimize Caching ● Configure web server for caching static resources ○ Set far future Expires header ○ Set Cache-Control ○ Configure ETags ● Set caching headers aggressively for all static resources ● Cache redirections ● Use fingerprinting to dynamically enable caching. ● Don't include a query string in the URL for static resources. ● Don't enable proxy caching for resources that set cookies. ● Be aware of issues with proxy caching of JS and CSS files.
  • 16. Tech Meetup: Web Applications Performance Cache headers example Request: Response: Accept-Encoding:gzip,deflate,sdch Content-Encoding: gzip Cache-Control: max-age=0 Cache-Control: public | private, no-cache, no- store, must-revalidate Expires:Mon, 16 Mar 2015 00:07:51 GMT If-None-Match: eb3878bf2bb06c1e33f1b09b285d13e0 ETag:eb3878bf2bb06c1e33f1b09b285d13e0 Connection:keep-alive Connection:Keep-Alive Keep-Alive:timeout=5, max=100 If-Modified-Since: Mon, 16 Mar 2015 00:07:51 GMT Last-Modified: Mon, 16 Mar 2015 00:07:51 GMT
  • 17. Tech Meetup: Web Applications Performance Minimize round-trip times ● Use a CDN for static content ● Minimize DNS lookups ● Minimize redirects ● Avoid bad requests ● Combine JS files ● Combine CSS files ● Combine images using sprites ● Use inline images when needed: ○ data: URL scheme ● Use image maps when possible ● Use font icons if available ● Put external scripts after external stylesheets if possible. ● Put inline scripts after other resources if possible. ● Avoid document.write ● Prefer async resources ○ async HTML5 attribute
  • 18. Tech Meetup: Web Applications Performance Minimize request overhead ● Don’t store large amounts of data on cookies ● Serve static content from a cookie-less domain ● Use server-side storage for most of the cookie payload ● Remove unused or duplicated cookie fields
  • 19. Tech Meetup: Web Applications Performance Minimize Payload Size ● Optimize Images ○ Use an appropriate file format ○ Use an image compressor ● Serve scaled version of images ● Defer loading of resources not used on startup ● Enable Compression ○ Write your web page content to make compression most effective ● Minify Javascript ● Minify CSS ○ Remove unused CSS ● Minify HTML ○ Omit optional HTML tags/attrib.
  • 20. Tech Meetup: Web Applications Performance Optimize browser rendering ● Apply animations with position fixed or absolute ● Add/remove classes not styles ● Specify image dimensions ○ that match those of the images on the img element or block-level parent ● Specify a character set ○ Always specify a content type and correct character encoding. ● Reduce number of DOM elems. ● Batch DOM changes ● Stay away from table layouts ● Put CSS in the document head ● Use efficient CSS selectors ○ Avoid a universal key selector ○ Make your rules as specific as possible. ○ Remove redundant qualifiers. ○ Use class selectors instead of descendant selectors. ● Avoid CSS expressions ● Avoid reflows: ○ Change CSS classes as low in the DOM as possible
  • 21. Tech Meetup: Web Applications Performance Optimize jQuery ● Use $(window).load( ) instead of $(document).ready( ) when possible. ● Use object detection even if jQuery doesn't throw an error ● Use direct functions rather than their convenience counterparts ● Avoid using jquery in loops ● Cache jQuery objects: $id = $(‘#id’) ● Chain instead of repeat ● Always descend from an id: $(‘#id’).find( ) ● Use (HTML5) tags before classes $(‘p’) ● Always prefix a class with a tag name ● Avoid using general selectors
  • 22. Tech Meetup: Web Applications Performance Optimize JavaScript ● Use strict mode: “use strict”; ● Use window.performance ● Listen for events lower in the DOM ● Bind multiple events at once ● Remember to unbind events when they are no longer needed ● Avoid unnecessary closures ● Avoid creating functions unnecessarily ● Cache references ● Cache AJAX results in an variable ● Store references to elements deep in arrays when calling multiple times. ● Use Local variables ● Batch DOM changes
  • 23. Tech Meetup: Web Applications Performance Tools Analysis Tools ● Chrome Dev Tools ● Firebug ● YSlow extension ● PageSpeed Insights / extension ● Web Page Test ● Apache Benchmark Compression Tools ● YUI Compressor ● Closure Compiler ● JSmin ● SpriteMe ● Smush.it
  • 24. Tech Meetup: Web Applications Performance Chrome Dev Tools
  • 25. Tech Meetup: Web Applications Performance Firebug
  • 26. Tech Meetup: Web Applications Performance Perception of speed ● The 100ms rule: “No single JavaScript job should execute for more than 100ms to ensure a responsive UI” ● Ensure a fast response ● Keep the user busy on waits ● Use progress bar indicators ● Staring at a blank page is not a good user experience ● Quickly show the skeleton of the screen
  • 27. Tech Meetup: Web Applications Performance Thanks!