SlideShare uma empresa Scribd logo
1 de 65
Baixar para ler offline
Snappy Means Happy
Performance in Ember Apps
@mixonic
httP://madhatted.com
matt.beale@madhatted.com
201 Created
We build õ-age apps with Ember.js. We take
teams from £ to • in no time flat.
http://bit.ly/emberconf-edge
JavaScript
emberjs.jsbin.com/viron/1
Network
Render
Network
Render
emberjs.jsbin.com/viron/1
Web Applications
Ember
Applications
Web Performance
Ember
Performance
What to think about
How Fast is Fast?
Jakob Nielsen sez
100 ms
1 second
10 seconds
instant
uninterrupted work
the limit of attention
www.nngroup.com/articles/response-times-3-important-limits/
Ilya Grigorik sez
0 - 100ms
100 - 300ms
300 - 1000ms
1 second +
10 seconds +
Instant
slight perceptible delay
perceptible delay
mental context switch
“I’ll come back later”
youtu.be/7ubJzEi3HuA?t=4m25s
@mixonic sez
16ms
300ms
1 second +
10 seconds +
60 fps - Animation
snappy
waiting
Lost a user
Opportunities for improvement
Network
Render
NetworkRender
JavaScript
uni.madhatted.com/emberconf/github-list/index.html
Animation, < 16ms
Javascript renDer
Snappy, less than 300 ms
Javascript renDerNetwork
One second and beyond
JavascriptNetwork
Methodology
1. Gather facts
2. Analyze & theorize
3. Change a single thing
1. Gather facts
2. Analyze & theorize
3. Change a single thing
4. Confirm the theory
Real World
Speeding up emberjs.com on a phone
ember.js website, why so slow?
Analyze using a latency emulator & Chrome devtools “Network” tab
1 second
emberjs.com
3.5 seconds
emberjs.com
emberjs.com
16 seconds!
emberjs.com
Charles - http://www.charlesproxy.com/
Slowy - http://slowyapp.com/
Network Link Conditioner - https://developer.apple.com/...
#1 reproduce mobile latency reliably
#2 create a clean browser environment
No extensions, privatewindow
support.google.com/chrome/answer/2364824?hl=en
#3 measurement & analysis
developers.google.com/chrome-developer-tools/docs/network
#3 measurement & analysis
Blocking
JavaScriptAssets in HTML
Assets in CSS
Javascript
CSS
HTML
ASSETS
ASSETS
assets
HTML Head JS Network+Parse
✦ Script at the bottom
✦ script async/defer
✦ explicitly load webfont in HTML (via
script or link tag)
#4 Solutions
Javascript
CSS
HTML
ASSETS
ASSETS
assets
HTML Head JS Network+Parse
#5 confirm the theory
https://github.com/emberjs/website/pull/1337
www.amazon.com/High-Performance-Browser-Networking-performance/dp/1449344763
Making an animation smooth
Janky animation
Using continuous paint, composited borders, Chrome devtools “Timeline”
DOM TREe RENDER TREe
LAYOUT PAINT composite
#1 understanding browsers
#2 Measure
Summary
developers.google.com/chrome-developer-tools/docs/timeline
Better summary
Frames
#2 Measure
developers.google.com/chrome-developer-tools/docs/timeline#frames_mode
JavaScript
#2 Measure
developers.google.com/chrome-developer-tools/docs/timeline#frames_mode
Paint
#2 Measure
developers.google.com/chrome-developer-tools/docs/timeline#frames_mode
Upload to GPU,

Compositing
#2 Measure
developers.google.com/chrome-developer-tools/docs/timeline#frames_mode
Open a render console
Special render options
#2 Measure
developers.google.com/chrome-developer-tools/docs/timeline#frames_mode
Live coding OMG.
debugging a janky animation
uni.madhatted.com/emberconf/animation-initial/index.html
uni.madhatted.com/emberconf/animation/index.html
uni.madhatted.com/emberconf/animation-second/index.html
screencast.com/t/TqtMmnvhiQg screencast.com/t/Hl6krsx3lN
Ember.js Property change notifications
Chrome devtools “Timeline”, profiles
1 var person = Ember.Object.extend({
2 name: 'rick'
3 logNameChange: function(){
4 console.log('observing name!');
5 }.observes('name')
6 });
7
8 person.set('name', 'bob');
9 console.log('after name!');
#1 understanding observers
1 var person = Ember.Object.extend({
2 name: 'rick'
3 logNameChange: function(){
4 console.log('observing name!');
5 }.observes('name')
6 });
7
8 person.set('name', 'bob');
9 console.log('after name!');
Logs first
observers are synchronous
1 var person = Ember.Object.extend({
2 name: 'rick'
3 somethingExpensive: function(){
4 // Something really heavy
5 }.observes('name', 'age', 'shoeSize')
6 });
7
8 person.set('name', 'bob');
9 person.set('age', 25);
10 person.set('shoeSize', 11);
somethingExpensive, x3
observers are synchronous
1 var person = Ember.Object.extend({
2 name: 'rick'
3 somethingExpensive: function(){
4 // Something really heavy
5 }.observes('name', 'age', 'shoeSize')
6 });
7
8 person.setProperties({
9 name: 'bob',
10 age: 25,
11 shoeSize: 11
12 }); somethingExpensive, once
observers are synchronous
1 var person = Ember.Object.extend({
2 name: 'rick'
3 scheduleSomethingExpensive: function(){
4 Ember.run.once(this, this.somethingExpensive);
5 }.observes('name', 'age', 'shoeSize'),
6 somethingExpensive: function(){
7 // Something really heavy
8 }
9 });
10
11 person.set('name', 'bob');
12 person.set('age', 25);
13 person.set('shoeSize', 11);
somethingExpensive, once
observers are synchronous
#2 profiler
Processing
Memory
developers.google.com/chrome-developer-tools/docs/cpu-profiling
#2 profiler
Modesdevelopers.google.com/chrome-developer-tools/docs/cpu-profiling#flame-chart
#2 profiler
Runloop
jQuery
View Event
developers.google.com/chrome-developer-tools/docs/cpu-profiling#flame-chart
#2 profiler
developers.google.com/chrome-developer-tools/docs/cpu-profiling#flame-chart
#2 profiler
Ember.run(function
developers.google.com/chrome-developer-tools/docs/cpu-profiling#flame-chart
#2 profiler
Queues
developers.google.com/chrome-developer-tools/docs/cpu-profiling#flame-chart
Live coding OMG.
debugging a slow list render
uni.madhatted.com/emberconf/push-into-array/index.html
uni.madhatted.com/emberconf/push-into-array-optimized/index.html
screencast.com/t/GMIHB4q4xyr screencast.com/t/xEagiQzyz
Web Performance
Ember
Performance
Javascript
renDer
Network
1. Gather facts
2. Analyze & theorize
3. Change a single thing
4. Confirm the theory

Mais conteúdo relacionado

Mais procurados

Debugging Web Apps on Real Mobile Devices
Debugging Web Apps on Real Mobile DevicesDebugging Web Apps on Real Mobile Devices
Debugging Web Apps on Real Mobile Devices
Dale Lane
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
Troy Miles
 
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
Sébastien Levert
 

Mais procurados (20)

Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
Debugging Web Apps on Real Mobile Devices
Debugging Web Apps on Real Mobile DevicesDebugging Web Apps on Real Mobile Devices
Debugging Web Apps on Real Mobile Devices
 
Hybrid mobile apps
Hybrid mobile appsHybrid mobile apps
Hybrid mobile apps
 
An iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React NativeAn iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React Native
 
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
 
SONY BBS - React Native
SONY BBS - React NativeSONY BBS - React Native
SONY BBS - React Native
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 
When to (use / not use) React Native.
When to (use / not use) React Native.When to (use / not use) React Native.
When to (use / not use) React Native.
 
Adobe and Modern Web Development
Adobe and Modern Web DevelopmentAdobe and Modern Web Development
Adobe and Modern Web Development
 
What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?
 
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
 
Ionic CLI Adventures
Ionic CLI AdventuresIonic CLI Adventures
Ionic CLI Adventures
 
Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)
 
Contributing to open source
Contributing to open sourceContributing to open source
Contributing to open source
 
WebDU Keynote
WebDU KeynoteWebDU Keynote
WebDU Keynote
 
The Future of HTML5 Motion Design
The Future of HTML5 Motion DesignThe Future of HTML5 Motion Design
The Future of HTML5 Motion Design
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
Android development war stories
Android development war storiesAndroid development war stories
Android development war stories
 
Ionic adventures - Hybrid Mobile App Development rocks
Ionic adventures - Hybrid Mobile App Development rocksIonic adventures - Hybrid Mobile App Development rocks
Ionic adventures - Hybrid Mobile App Development rocks
 

Semelhante a Snappy Means Happy: Performance in Ember Apps

Chris szafranek
Chris szafranekChris szafranek
Chris szafranek
FDC13
 

Semelhante a Snappy Means Happy: Performance in Ember Apps (20)

Getting the most Out of Your Tools
Getting the most Out of Your ToolsGetting the most Out of Your Tools
Getting the most Out of Your Tools
 
Chris szafranek
Chris szafranekChris szafranek
Chris szafranek
 
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
Chrome Dev Summit Summary 2013 part 1 - what’s hot ?
 
Running HTML5 Mobile Web Games at 60fps
Running HTML5 Mobile Web Games at 60fpsRunning HTML5 Mobile Web Games at 60fps
Running HTML5 Mobile Web Games at 60fps
 
Android design lecture #1
Android design   lecture #1Android design   lecture #1
Android design lecture #1
 
Hacking to be performant
Hacking to be performantHacking to be performant
Hacking to be performant
 
Tools and Techniques for Faster Development
Tools and Techniques for Faster DevelopmentTools and Techniques for Faster Development
Tools and Techniques for Faster Development
 
Ruby in the Browser - RubyConf 2011
Ruby in the Browser - RubyConf 2011Ruby in the Browser - RubyConf 2011
Ruby in the Browser - RubyConf 2011
 
Core web vitals – Business impact and best practices - Meet Magento UK 2021
Core web vitals – Business impact and best practices - Meet Magento UK 2021Core web vitals – Business impact and best practices - Meet Magento UK 2021
Core web vitals – Business impact and best practices - Meet Magento UK 2021
 
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
AAA 3D GRAPHICS ON THE WEB WITH REACTJS + BABYLONJS + UNITY3D by Denis Radin ...
 
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3DJS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
JS Fest 2019. Денис Радин. AAA 3D графика в Web с ReactJS, BabylonJS и Unity3D
 
Beware the potholes
Beware the potholesBeware the potholes
Beware the potholes
 
Advanced #4 GPU & Animations
Advanced #4   GPU & AnimationsAdvanced #4   GPU & Animations
Advanced #4 GPU & Animations
 
The latest in site speed: advanced #webperf 2018
The latest in site speed: advanced #webperf 2018The latest in site speed: advanced #webperf 2018
The latest in site speed: advanced #webperf 2018
 
Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)
 
Accelerated Mobile - Beyond AMP
Accelerated Mobile - Beyond AMPAccelerated Mobile - Beyond AMP
Accelerated Mobile - Beyond AMP
 
Presentation on Fresco
Presentation on FrescoPresentation on Fresco
Presentation on Fresco
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 upload
 
Speed is Essential for a Great Web Experience
Speed is Essential for a Great Web ExperienceSpeed is Essential for a Great Web Experience
Speed is Essential for a Great Web Experience
 
Single Page Applications – Know The Ecosystem system
Single Page Applications – Know The Ecosystem systemSingle Page Applications – Know The Ecosystem system
Single Page Applications – Know The Ecosystem system
 

Mais de Matthew Beale

Scalable vector ember
Scalable vector emberScalable vector ember
Scalable vector ember
Matthew Beale
 

Mais de Matthew Beale (15)

Ember.js Module Loading
Ember.js Module LoadingEmber.js Module Loading
Ember.js Module Loading
 
LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017LA Ember.js Meetup, Jan 2017
LA Ember.js Meetup, Jan 2017
 
Interoperable Component Patterns
Interoperable Component PatternsInteroperable Component Patterns
Interoperable Component Patterns
 
Ember Community 2016 - Be the Bark
Ember Community 2016 - Be the BarkEmber Community 2016 - Be the Bark
Ember Community 2016 - Be the Bark
 
Attribute actions
Attribute actionsAttribute actions
Attribute actions
 
The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)
The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)
The Hidden Power of HTMLBars (or, Scope in Ember.js Templates)
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
 
New Component Patterns in Ember.js
New Component Patterns in Ember.jsNew Component Patterns in Ember.js
New Component Patterns in Ember.js
 
Scalable vector ember
Scalable vector emberScalable vector ember
Scalable vector ember
 
Testing Ember Apps: Managing Dependency
Testing Ember Apps: Managing DependencyTesting Ember Apps: Managing Dependency
Testing Ember Apps: Managing Dependency
 
Parse Apps with Ember.js
Parse Apps with Ember.jsParse Apps with Ember.js
Parse Apps with Ember.js
 
Client-side Auth with Ember.js
Client-side Auth with Ember.jsClient-side Auth with Ember.js
Client-side Auth with Ember.js
 
Containers & Dependency in Ember.js
Containers & Dependency in Ember.jsContainers & Dependency in Ember.js
Containers & Dependency in Ember.js
 
Complex Architectures in Ember
Complex Architectures in EmberComplex Architectures in Ember
Complex Architectures in Ember
 
Ember and containers
Ember and containersEmber and containers
Ember and containers
 

Último

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Snappy Means Happy: Performance in Ember Apps