SlideShare a Scribd company logo
Performance Engineering by Franz See (DevCon Java Roadshow) (ValueCommerce) [email_address] http://twitter.com/franz_see
UI Performance Page Loading Optimization
Best Practices Optimizing caching  — keeping your application's data and logic  off  the network altogether Minimizing round-trip times  — reducing the number of serial request-response cycles Minimizing request size  — reducing upload size Minimizing payload size  — reducing the size of responses, downloads, and cached pages Optimizing browser rendering  — improving the browser's layout of a page
Optimize caching HTTP caching allows these resources to be saved, or cached, by a browser or proxy. Once a resource is cached, a browser or proxy can refer to the locally cached copy instead of having to download it again on subsequent visits to the web page. Thus caching is a double win: you reduce round-trip time by eliminating numerous HTTP requests for the required resources, and you substantially reduce the total payload size of the responses. Besides leading to a dramatic reduction in page load time for subsequent user visits, enabling caching can also significantly reduce the bandwidth and hosting costs for your site.
Optimize caching Leverage browser caching -  Setting an expiry date or a maximum age in the HTTP headers for static resources allows the browser to load previously downloaded resources from local disk rather than over the network. Leverage proxy caching -  Enabling public caching in the HTTP headers for static resources allows the browser to download resources from a nearby proxy server rather than from a remoter origin server.
Minimize round-trip times Round-trip time (RTT) is the time it takes for a client to send a request and the server to send a response over the network, not including the time required for data transfer. That is, it includes the back-and-forth time on the wire, but excludes the time to fully download the transferred bytes (and is therefore unrelated to bandwidth). For example, for a browser to initiate a first-time connection with a web server, it must incur a minimum of 3 RTTs: 1 RTT for DNS name resolution; 1 RTT for TCP connection setup; and 1 RTT for the HTTP request and first byte of the HTTP response. Many web pages require dozens of RTTs.
Minimize round-trip times  Minimize DNS lookups -  Reducing the number of unique hostnames from which resources are served cuts down on the number of DNS resolutions that the browser has to make, and therefore, RTT delays. Minimize redirects -  Minimizing HTTP redirects from one URL to another cuts out additional RTTs and wait time for users. Combine external JavaScript -  Combining external scripts into as few files as possible cuts down on RTTs and delays in downloading other resources.
Minimize request size Every time a client sends an HTTP request, it has to send all associated cookies that have been set for that domain and path along with it. Most users have asymmetric Internet connections: upload-to-download bandwidth ratios are commonly in the range of 1:4 to 1:20. This means that a 500-byte HTTP header request could take the equivalent time to upload as 10 KB of HTTP response data takes to download. The factor is actually even higher because HTTP request headers are sent uncompressed. In other words, for requests for small objects (say, less than 10 KB, the typical size of a compressed image), the data sent in a request header can account for the majority of the response time.
Minimize request size Minimize cookie size -  Keeping cookies as small as possible ensures that an HTTP request can fit into a single packet. Serve static content from a cookieless domain -  Serving static resources from a cookieless domain reduces the total size of requests made for a page.
Minimize payload size The amount of data sent in each server response can add significant latency to your application, especially in areas where bandwidth is constrained. In addition to the network cost of the actual bytes transmitted, there is also a penalty incurred for crossing an IP packet boundary. (The maximum packet size, or Maximum Transmission Unit (MTU), is 1500 bytes on an Ethernet network, but varies on other types of networks.) Unfortunately, since it's difficult to know which bytes will cross a packet boundary, the best practice is to simply reduce the number of packets your server transmits, and strive to keep them under 1500 bytes wherever possible.
Minimize payload size Enable gzip compression -  Compressing resources with gzip can reduce the number of bytes sent over the network. Remove unused CSS -  Removing or deferring style rules that are not used by a document avoid downloads unnecessary bytes and allow the browser to start rendering sooner.  Minify JavaScript -  Compacting JavaScript code can save many bytes of data and speed up downloading, parsing, and execution time.
Minimize payload size Defer loading of JavaScript -  Deferring loading of JavaScript functions that are not called at startup reduces the initial download size, allowing other resources to be downloaded in parallel, and speeding up execution and rendering time. Optimize images -  Properly formatting, sizing, and losslessly compressing images can save many bytes of data. Serve resources from a consistent URL -  It's important to serve a resource from a unique URL, to eliminate duplicate download bytes and additional RTTs.
Optimize browser rendering Once resources have been downloaded to the client, the browser still needs to load, interpret, and render HTML, CSS, and Javascript code. By simply formatting your code and pages in ways that exploit the characteristics of current browsers, you can enhance performance on the client side.
Optimize browser rendering Use efficient CSS selectors -  Avoiding inefficient key selectors that match large numbers of elements can speed up page rendering. Avoid CSS expressions -  CSS expressions degrade rendering performance; replacing them with alternatives will improve browser rendering for IE users. This best practices in this section apply only to Internet Explorer 5 through 7, which support CSS expressions. Put CSS in the document head -  Moving inline style blocks and <link> elements from the document body to the document head improves rendering performance. Specify image dimensions -  Specifying a width and height for all images allows for faster rendering by eliminating the need for unnecessary reflows and repaints.
Tips and Tricks Remove all 404 resources. Access logs to check 404 resources. grep 'HTTP/1.1&quot; 404' access.log Put CSS at the top, and CSS first before JS Put JS at the end of the page Set a reasonable buffer size for JSP for eager loading if possible divisible by 1500 bytes. <%@ page buffer=&quot;36kb&quot; %>
Tips and Tricks Enable GZIP using GZIP filter for text content types Pre GZIP Text static resources (Custom ant task) Compress images Page speed provides you with the compressed image https://developer.yahoo.com/yslow/smushit/ Minify JavaScript, CSS or even dynamic (JSP) contents YUI compressor from Yahoo! Closure Tools from Google Combining of external JavaScript and CSS resources Custom ant tasks CSS sprites http://csssprites.com/
Tips and Tricks Browser caching using http header Cache-Control response header with at least one month expiration Ideally for static resources, and can be done also on get Ajax calls Caching of asynchronous call results (page scope) Progressive loading using Ajax Deferred loading
Tips and Tricks Use performance analyzer tools Yslow! from Yahoo! Page speed from Google
Possible UI Performance Drawback Maintainability  Support for JavaScript debugging is now impossible Minify JavaScript and CSS resources Combining of external JavaScript and CSS resources
References http://code.google.com/speed/page-speed/docs/rules_intro.html https://developer.yahoo.com/yslow/ https://developer.yahoo.com/yslow/smushit/ http://csssprites.com/ http://developer.yahoo.com/yui/compressor/ http://code.google.com/closure/
Back End Performance Engineering
Problems? Slow down Out of Memory
What are they? Profiler A form of Dynamic Program Analysis for  Improving performance Heap Analysis Tool Tool for analyzing heap dumps
Example
Example
Example
Popular Profiling Tools Paid JProfiler YourKit Free Eclipse TPTP Netbeans Profiler Visual VM (comes with java 6u7)
Popular Heap Analysis Tools Jhat Eclipse Memory Analyzer Tool <Profiling tools>
Common Profiling Views Self Tree Telemetry CPU Duration Per Method Call Tree CPU Load Memory Size per object of type Dominator Tree Memory Load Thread Duration per thread (---) (---)
Heap Analysis Quick recap of the Java Memory Model Learning to generate heap dumps (hprof) Setting up the Eclipse Memory Analyzer Tool The 3 basic reports – Overview, Leak Suspects, and Top Components The 'other' features
Java Memory Model Heap Young GEn Par Eden Space Par Survivor Space CMS Old Gen Non-Heap Code Cache CMS Perm Gen More info:  http://download.oracle.com/javase/6/docs/ ...  ...technotes/guides/management/jconsole.html
Generate HPROF -XX:+HeapDumpOnOutOfMemoryError jmap -heap:format=b <pid> jmap.exe -dump:format=b,file=HeapDump.hprof <pid> More info : http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_Heap_Dump
Setup Eclipse MAT Home Page : http://www.eclipse.org/mat/ Download Page : http://www.eclipse.org/mat/downloads.php Quick Start: http://wiki.eclipse.org/index.php/MemoryAnalyzer
3 Basic Reports Overview Leak Suspects Top Components
The 'other' features. Histogram Dominator Tree OQL
OQL
Histogram
 
Last Tips & Tricks 1.) Premature Optmization is the source of all evil 2.) Validate Assumptions 3.) Avoid blind fixes as much as possible 4.) Differentiate between CPU & IO 5.) Work Together
Thank You Questions? [email_address] http://devworks.devcon.ph http://devcon.ph http://facebook.com/DevConPH http://twitter.com/DevConPH http://twitter.com/franz_see
Ad

More Related Content

What's hot (20)

Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloudStress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Andy Kucharski
 
Optimiszing proxy
Optimiszing proxyOptimiszing proxy
Optimiszing proxy
Proxies Rent
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
Andy Kucharski
 
EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best Practices
EDB
 
World Wide Web Caching
World Wide Web CachingWorld Wide Web Caching
World Wide Web Caching
ersanbilik
 
QSpiders - Installation and Brief Dose of Load Runner
QSpiders - Installation and Brief Dose of Load RunnerQSpiders - Installation and Brief Dose of Load Runner
QSpiders - Installation and Brief Dose of Load Runner
Qspiders - Software Testing Training Institute
 
Weblogic performance tuning2
Weblogic performance tuning2Weblogic performance tuning2
Weblogic performance tuning2
Aditya Bhuyan
 
Weblogic plug in
Weblogic plug inWeblogic plug in
Weblogic plug in
Aditya Bhuyan
 
Understanding Web Cache
Understanding Web CacheUnderstanding Web Cache
Understanding Web Cache
ProdigyView
 
Weblogic performance tuning1
Weblogic performance tuning1Weblogic performance tuning1
Weblogic performance tuning1
Aditya Bhuyan
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
SPC Adriatics
 
The Magic of Tuning in PostgreSQL
The Magic of Tuning in PostgreSQLThe Magic of Tuning in PostgreSQL
The Magic of Tuning in PostgreSQL
Ashnikbiz
 
Implementing High Performance Drupal Sites
Implementing High Performance Drupal SitesImplementing High Performance Drupal Sites
Implementing High Performance Drupal Sites
Shri Kumar
 
Optimiszing proxy
Optimiszing proxyOptimiszing proxy
Optimiszing proxy
Proxies Rent
 
Building a Scalable Architecture for web apps
Building a Scalable Architecture for web appsBuilding a Scalable Architecture for web apps
Building a Scalable Architecture for web apps
Directi Group
 
Weblogic security
Weblogic securityWeblogic security
Weblogic security
Aditya Bhuyan
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in Java
Ruben Badaró
 
Scalable Integration with JBoss Fuse
Scalable Integration with JBoss FuseScalable Integration with JBoss Fuse
Scalable Integration with JBoss Fuse
Christina Lin
 
OTM in the Cloud - OTM SIG 2012
OTM in the Cloud - OTM SIG 2012OTM in the Cloud - OTM SIG 2012
OTM in the Cloud - OTM SIG 2012
MavenWire
 
Scalable Text File Service with MongoDB (Intuit)
Scalable Text File Service with MongoDB (Intuit)Scalable Text File Service with MongoDB (Intuit)
Scalable Text File Service with MongoDB (Intuit)
MongoDB
 
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloudStress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Andy Kucharski
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
Andy Kucharski
 
EDB Postgres DBA Best Practices
EDB Postgres DBA Best PracticesEDB Postgres DBA Best Practices
EDB Postgres DBA Best Practices
EDB
 
World Wide Web Caching
World Wide Web CachingWorld Wide Web Caching
World Wide Web Caching
ersanbilik
 
Weblogic performance tuning2
Weblogic performance tuning2Weblogic performance tuning2
Weblogic performance tuning2
Aditya Bhuyan
 
Understanding Web Cache
Understanding Web CacheUnderstanding Web Cache
Understanding Web Cache
ProdigyView
 
Weblogic performance tuning1
Weblogic performance tuning1Weblogic performance tuning1
Weblogic performance tuning1
Aditya Bhuyan
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
SPC Adriatics
 
The Magic of Tuning in PostgreSQL
The Magic of Tuning in PostgreSQLThe Magic of Tuning in PostgreSQL
The Magic of Tuning in PostgreSQL
Ashnikbiz
 
Implementing High Performance Drupal Sites
Implementing High Performance Drupal SitesImplementing High Performance Drupal Sites
Implementing High Performance Drupal Sites
Shri Kumar
 
Building a Scalable Architecture for web apps
Building a Scalable Architecture for web appsBuilding a Scalable Architecture for web apps
Building a Scalable Architecture for web apps
Directi Group
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in Java
Ruben Badaró
 
Scalable Integration with JBoss Fuse
Scalable Integration with JBoss FuseScalable Integration with JBoss Fuse
Scalable Integration with JBoss Fuse
Christina Lin
 
OTM in the Cloud - OTM SIG 2012
OTM in the Cloud - OTM SIG 2012OTM in the Cloud - OTM SIG 2012
OTM in the Cloud - OTM SIG 2012
MavenWire
 
Scalable Text File Service with MongoDB (Intuit)
Scalable Text File Service with MongoDB (Intuit)Scalable Text File Service with MongoDB (Intuit)
Scalable Text File Service with MongoDB (Intuit)
MongoDB
 

Viewers also liked (6)

Testing in-groovy
Testing in-groovyTesting in-groovy
Testing in-groovy
Franz Allan See
 
Ui perf
Ui perfUi perf
Ui perf
Franz Allan See
 
Presentation1
Presentation1Presentation1
Presentation1
Rosie brown
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & Tuning
Timothy Wood
 
High Performance - Joomla!Days NL 2009 #jd09nl
High Performance - Joomla!Days NL 2009 #jd09nlHigh Performance - Joomla!Days NL 2009 #jd09nl
High Performance - Joomla!Days NL 2009 #jd09nl
Joomla!Days Netherlands
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12
Franz Allan See
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & Tuning
Timothy Wood
 
High Performance - Joomla!Days NL 2009 #jd09nl
High Performance - Joomla!Days NL 2009 #jd09nlHigh Performance - Joomla!Days NL 2009 #jd09nl
High Performance - Joomla!Days NL 2009 #jd09nl
Joomla!Days Netherlands
 
Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12Robotframework Presentation - Pinoy Python Meetup 2011January12
Robotframework Presentation - Pinoy Python Meetup 2011January12
Franz Allan See
 
Ad

Similar to Performance engineering (20)

Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
Brian Huff
 
Configuring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceConfiguring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web Perormance
Spark::red
 
Browser Caching
Browser CachingBrowser Caching
Browser Caching
Jaiswal Siddharth
 
Tips to improve your website performance
Tips to improve your website performanceTips to improve your website performance
Tips to improve your website performance
WebGuru Infosystems Pvt. Ltd.
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
sacred 8
 
Client-side Website Optimization
Client-side Website OptimizationClient-side Website Optimization
Client-side Website Optimization
Radu Pintilie
 
Improving web site performance and scalability while saving
Improving web site performance and scalability while savingImproving web site performance and scalability while saving
Improving web site performance and scalability while saving
mdc11
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizing
Ashok Modi
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
Craig Walker
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Jonathan Klein
 
Web performance Talk
Web performance TalkWeb performance Talk
Web performance Talk
Prasoon Agrawal
 
Web site loading time optimization
Web site loading time optimizationWeb site loading time optimization
Web site loading time optimization
Damith Kothalawala
 
Web Site Optimization
Web Site OptimizationWeb Site Optimization
Web Site Optimization
Sunil Patil
 
Web site optimization
Web site optimizationWeb site optimization
Web site optimization
Sunil Patil
 
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGReducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Maarten Balliauw
 
Website Performance at Client Level
Website Performance at Client LevelWebsite Performance at Client Level
Website Performance at Client Level
Constantin Stan
 
Ajax For Scalability
Ajax For ScalabilityAjax For Scalability
Ajax For Scalability
erikschultink
 
AJAX for Scalability
AJAX for ScalabilityAJAX for Scalability
AJAX for Scalability
Tuenti
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
Jason Ragsdale
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
Hugo Fonseca
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
Brian Huff
 
Configuring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceConfiguring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web Perormance
Spark::red
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
sacred 8
 
Client-side Website Optimization
Client-side Website OptimizationClient-side Website Optimization
Client-side Website Optimization
Radu Pintilie
 
Improving web site performance and scalability while saving
Improving web site performance and scalability while savingImproving web site performance and scalability while saving
Improving web site performance and scalability while saving
mdc11
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizing
Ashok Modi
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
Craig Walker
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Jonathan Klein
 
Web site loading time optimization
Web site loading time optimizationWeb site loading time optimization
Web site loading time optimization
Damith Kothalawala
 
Web Site Optimization
Web Site OptimizationWeb Site Optimization
Web Site Optimization
Sunil Patil
 
Web site optimization
Web site optimizationWeb site optimization
Web site optimization
Sunil Patil
 
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGReducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Maarten Balliauw
 
Website Performance at Client Level
Website Performance at Client LevelWebsite Performance at Client Level
Website Performance at Client Level
Constantin Stan
 
Ajax For Scalability
Ajax For ScalabilityAjax For Scalability
Ajax For Scalability
erikschultink
 
AJAX for Scalability
AJAX for ScalabilityAJAX for Scalability
AJAX for Scalability
Tuenti
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
Jason Ragsdale
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
Hugo Fonseca
 
Ad

Recently uploaded (20)

Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 

Performance engineering

  • 1. Performance Engineering by Franz See (DevCon Java Roadshow) (ValueCommerce) [email_address] http://twitter.com/franz_see
  • 2. UI Performance Page Loading Optimization
  • 3. Best Practices Optimizing caching — keeping your application's data and logic off the network altogether Minimizing round-trip times — reducing the number of serial request-response cycles Minimizing request size — reducing upload size Minimizing payload size — reducing the size of responses, downloads, and cached pages Optimizing browser rendering — improving the browser's layout of a page
  • 4. Optimize caching HTTP caching allows these resources to be saved, or cached, by a browser or proxy. Once a resource is cached, a browser or proxy can refer to the locally cached copy instead of having to download it again on subsequent visits to the web page. Thus caching is a double win: you reduce round-trip time by eliminating numerous HTTP requests for the required resources, and you substantially reduce the total payload size of the responses. Besides leading to a dramatic reduction in page load time for subsequent user visits, enabling caching can also significantly reduce the bandwidth and hosting costs for your site.
  • 5. Optimize caching Leverage browser caching - Setting an expiry date or a maximum age in the HTTP headers for static resources allows the browser to load previously downloaded resources from local disk rather than over the network. Leverage proxy caching - Enabling public caching in the HTTP headers for static resources allows the browser to download resources from a nearby proxy server rather than from a remoter origin server.
  • 6. Minimize round-trip times Round-trip time (RTT) is the time it takes for a client to send a request and the server to send a response over the network, not including the time required for data transfer. That is, it includes the back-and-forth time on the wire, but excludes the time to fully download the transferred bytes (and is therefore unrelated to bandwidth). For example, for a browser to initiate a first-time connection with a web server, it must incur a minimum of 3 RTTs: 1 RTT for DNS name resolution; 1 RTT for TCP connection setup; and 1 RTT for the HTTP request and first byte of the HTTP response. Many web pages require dozens of RTTs.
  • 7. Minimize round-trip times Minimize DNS lookups - Reducing the number of unique hostnames from which resources are served cuts down on the number of DNS resolutions that the browser has to make, and therefore, RTT delays. Minimize redirects - Minimizing HTTP redirects from one URL to another cuts out additional RTTs and wait time for users. Combine external JavaScript - Combining external scripts into as few files as possible cuts down on RTTs and delays in downloading other resources.
  • 8. Minimize request size Every time a client sends an HTTP request, it has to send all associated cookies that have been set for that domain and path along with it. Most users have asymmetric Internet connections: upload-to-download bandwidth ratios are commonly in the range of 1:4 to 1:20. This means that a 500-byte HTTP header request could take the equivalent time to upload as 10 KB of HTTP response data takes to download. The factor is actually even higher because HTTP request headers are sent uncompressed. In other words, for requests for small objects (say, less than 10 KB, the typical size of a compressed image), the data sent in a request header can account for the majority of the response time.
  • 9. Minimize request size Minimize cookie size - Keeping cookies as small as possible ensures that an HTTP request can fit into a single packet. Serve static content from a cookieless domain - Serving static resources from a cookieless domain reduces the total size of requests made for a page.
  • 10. Minimize payload size The amount of data sent in each server response can add significant latency to your application, especially in areas where bandwidth is constrained. In addition to the network cost of the actual bytes transmitted, there is also a penalty incurred for crossing an IP packet boundary. (The maximum packet size, or Maximum Transmission Unit (MTU), is 1500 bytes on an Ethernet network, but varies on other types of networks.) Unfortunately, since it's difficult to know which bytes will cross a packet boundary, the best practice is to simply reduce the number of packets your server transmits, and strive to keep them under 1500 bytes wherever possible.
  • 11. Minimize payload size Enable gzip compression - Compressing resources with gzip can reduce the number of bytes sent over the network. Remove unused CSS - Removing or deferring style rules that are not used by a document avoid downloads unnecessary bytes and allow the browser to start rendering sooner. Minify JavaScript - Compacting JavaScript code can save many bytes of data and speed up downloading, parsing, and execution time.
  • 12. Minimize payload size Defer loading of JavaScript - Deferring loading of JavaScript functions that are not called at startup reduces the initial download size, allowing other resources to be downloaded in parallel, and speeding up execution and rendering time. Optimize images - Properly formatting, sizing, and losslessly compressing images can save many bytes of data. Serve resources from a consistent URL - It's important to serve a resource from a unique URL, to eliminate duplicate download bytes and additional RTTs.
  • 13. Optimize browser rendering Once resources have been downloaded to the client, the browser still needs to load, interpret, and render HTML, CSS, and Javascript code. By simply formatting your code and pages in ways that exploit the characteristics of current browsers, you can enhance performance on the client side.
  • 14. Optimize browser rendering Use efficient CSS selectors - Avoiding inefficient key selectors that match large numbers of elements can speed up page rendering. Avoid CSS expressions - CSS expressions degrade rendering performance; replacing them with alternatives will improve browser rendering for IE users. This best practices in this section apply only to Internet Explorer 5 through 7, which support CSS expressions. Put CSS in the document head - Moving inline style blocks and <link> elements from the document body to the document head improves rendering performance. Specify image dimensions - Specifying a width and height for all images allows for faster rendering by eliminating the need for unnecessary reflows and repaints.
  • 15. Tips and Tricks Remove all 404 resources. Access logs to check 404 resources. grep 'HTTP/1.1&quot; 404' access.log Put CSS at the top, and CSS first before JS Put JS at the end of the page Set a reasonable buffer size for JSP for eager loading if possible divisible by 1500 bytes. <%@ page buffer=&quot;36kb&quot; %>
  • 16. Tips and Tricks Enable GZIP using GZIP filter for text content types Pre GZIP Text static resources (Custom ant task) Compress images Page speed provides you with the compressed image https://developer.yahoo.com/yslow/smushit/ Minify JavaScript, CSS or even dynamic (JSP) contents YUI compressor from Yahoo! Closure Tools from Google Combining of external JavaScript and CSS resources Custom ant tasks CSS sprites http://csssprites.com/
  • 17. Tips and Tricks Browser caching using http header Cache-Control response header with at least one month expiration Ideally for static resources, and can be done also on get Ajax calls Caching of asynchronous call results (page scope) Progressive loading using Ajax Deferred loading
  • 18. Tips and Tricks Use performance analyzer tools Yslow! from Yahoo! Page speed from Google
  • 19. Possible UI Performance Drawback Maintainability Support for JavaScript debugging is now impossible Minify JavaScript and CSS resources Combining of external JavaScript and CSS resources
  • 20. References http://code.google.com/speed/page-speed/docs/rules_intro.html https://developer.yahoo.com/yslow/ https://developer.yahoo.com/yslow/smushit/ http://csssprites.com/ http://developer.yahoo.com/yui/compressor/ http://code.google.com/closure/
  • 21. Back End Performance Engineering
  • 22. Problems? Slow down Out of Memory
  • 23. What are they? Profiler A form of Dynamic Program Analysis for Improving performance Heap Analysis Tool Tool for analyzing heap dumps
  • 27. Popular Profiling Tools Paid JProfiler YourKit Free Eclipse TPTP Netbeans Profiler Visual VM (comes with java 6u7)
  • 28. Popular Heap Analysis Tools Jhat Eclipse Memory Analyzer Tool <Profiling tools>
  • 29. Common Profiling Views Self Tree Telemetry CPU Duration Per Method Call Tree CPU Load Memory Size per object of type Dominator Tree Memory Load Thread Duration per thread (---) (---)
  • 30. Heap Analysis Quick recap of the Java Memory Model Learning to generate heap dumps (hprof) Setting up the Eclipse Memory Analyzer Tool The 3 basic reports – Overview, Leak Suspects, and Top Components The 'other' features
  • 31. Java Memory Model Heap Young GEn Par Eden Space Par Survivor Space CMS Old Gen Non-Heap Code Cache CMS Perm Gen More info: http://download.oracle.com/javase/6/docs/ ... ...technotes/guides/management/jconsole.html
  • 32. Generate HPROF -XX:+HeapDumpOnOutOfMemoryError jmap -heap:format=b <pid> jmap.exe -dump:format=b,file=HeapDump.hprof <pid> More info : http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_Heap_Dump
  • 33. Setup Eclipse MAT Home Page : http://www.eclipse.org/mat/ Download Page : http://www.eclipse.org/mat/downloads.php Quick Start: http://wiki.eclipse.org/index.php/MemoryAnalyzer
  • 34. 3 Basic Reports Overview Leak Suspects Top Components
  • 35. The 'other' features. Histogram Dominator Tree OQL
  • 36. OQL
  • 38.  
  • 39. Last Tips & Tricks 1.) Premature Optmization is the source of all evil 2.) Validate Assumptions 3.) Avoid blind fixes as much as possible 4.) Differentiate between CPU & IO 5.) Work Together
  • 40. Thank You Questions? [email_address] http://devworks.devcon.ph http://devcon.ph http://facebook.com/DevConPH http://twitter.com/DevConPH http://twitter.com/franz_see

Editor's Notes

  • #32: Eden Space: The pool from which memory is initially allocated for most objects. Survivor Space: The pool containing objects that have survived the garbage collection of the Eden space. Tenured Generation: The pool containing objects that have existed for some time in the survivor space. Permanent Generation: The pool containing all the reflective data of the virtual machine itself, such as class and method objects. With Java VMs that use class data sharing, this generation is divided into read-only and read-write areas. Code Cache: The HotSpot Java VM also includes a code cache, containing memory that is used for compilation and storage of native code. Survivor Space: The pool containing objects that have survived the garbage collection of the Eden space.