SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
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!

Weitere ähnliche Inhalte

Was ist angesagt?

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 developersnuppla
 
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
 
Javascript basics
Javascript basicsJavascript basics
Javascript basicsFalcon2018
 
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
 
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 - NetPaneltoolitup
 
WDML design
WDML designWDML design
WDML designjomarweb
 
Client Side rendering Not so Easy
Client Side rendering Not so EasyClient Side rendering Not so Easy
Client Side rendering Not so Easynuria_ruiz
 
Scalable server component using NodeJS & ExpressJS
Scalable server component using NodeJS & ExpressJSScalable server component using NodeJS & ExpressJS
Scalable server component using NodeJS & ExpressJSAndhy Koesnandar
 
Visualize your graph database
Visualize your graph databaseVisualize your graph database
Visualize your graph databaseMichael 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 2013Andy Bunce
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance OptimizationChen-Tien Tsai
 

Was ist angesagt? (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
 

Andere mochten auch

ภาษาอังกฤษ
ภาษาอังกฤษภาษาอังกฤษ
ภาษาอังกฤษChalermraj Kaewyot
 
ข้อสอบ O net ศิลปะ ม.6 ชุด 1
ข้อสอบ O net ศิลปะ ม.6 ชุด 1ข้อสอบ O net ศิลปะ ม.6 ชุด 1
ข้อสอบ O net ศิลปะ ม.6 ชุด 1cookie47
 
ใบงานที่2
ใบงานที่2ใบงานที่2
ใบงานที่2warangnan
 
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์Plew Woo
 
Presentasi yang effektif
Presentasi yang effektifPresentasi yang effektif
Presentasi yang effektifayatbima
 
職業デザインセンター0114
職業デザインセンター0114職業デザインセンター0114
職業デザインセンター0114Takahiro Inoue
 
изменения
измененияизменения
измененияMurat77
 
ใบงานที่7
ใบงานที่7ใบงานที่7
ใบงานที่7warangnan
 
устав
уставустав
устав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.
 

Andere mochten auch (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に スクリーンプロテクターを貼る方法
 

Ähnlich wie 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 KrausWomen 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 scaleDmytro 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 KrausWomen 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.pptxGuy Bary
 
Journey through high performance django application
Journey through high performance django applicationJourney through high performance django application
Journey through high performance django applicationbangaloredjangousergroup
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkAlive Kuo
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performanceAndrew Siemer
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013Santiago 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 - MercadoLibrePablo Moretti
 
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 TurboGearsAlessandro 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 applicationsBrettTasker
 
NODE JS OC Meetup 1
NODE JS OC Meetup 1NODE JS OC Meetup 1
NODE JS OC Meetup 1eddify
 
Drupal 7 performance and optimization
Drupal 7 performance and optimizationDrupal 7 performance and optimization
Drupal 7 performance and optimizationShafqat Hussain
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend PerformanceThomas Weinert
 

Ähnlich wie 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
 

Mehr von Santex Group

Entender React Native
Entender React NativeEntender React Native
Entender React NativeSantex 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 VaporSantex Group
 
Tech Meetup: Jenkins, the moody buttler
Tech Meetup: Jenkins, the moody buttlerTech Meetup: Jenkins, the moody buttler
Tech Meetup: Jenkins, the moody buttlerSantex Group
 
Tech Meetup: Be reactive with Android
Tech Meetup: Be reactive with AndroidTech Meetup: Be reactive with Android
Tech Meetup: Be reactive with AndroidSantex 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 & iOSSantex Group
 
Tech Meetup: Gamificar con Agilidad
Tech Meetup: Gamificar con AgilidadTech Meetup: Gamificar con Agilidad
Tech Meetup: Gamificar con AgilidadSantex 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 JavaSantex 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 GITSantex Group
 
Tech MeetUp: Agile Methodologies in eCommerce
Tech MeetUp: Agile Methodologies in eCommerceTech MeetUp: Agile Methodologies in eCommerce
Tech MeetUp: Agile Methodologies in eCommerceSantex Group
 
Meetup: Mobile Automation
Meetup: Mobile AutomationMeetup: Mobile Automation
Meetup: Mobile AutomationSantex 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'sSantex 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 AgileSantex Group
 

Mehr von 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
 

Kürzlich hochgeladen

OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 

Kürzlich hochgeladen (20)

OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.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!