SlideShare a Scribd company logo
Perfomance
em animações
@hugobessaa
+ bonito
+ rico
+++ UX
Performance em animações
Performance em animações
Performance em animações
16ms 16ms 16ms 16ms 16ms
60fps
16ms
JS
Layout Paint Setup
Paint Composite
Layers
Layout
Layout
.box {
width: 300px;
height: 300px;
margin: 10px;
// ...
}
Layout
Layout
Paint
Paint
.box {
color: green;
border-style: solid;
// ...
}
Paint
Paint
Composite Layer
Composite Layer
.box {
opacity: 0.5;
transform: scale(1.2);
// ...
}
Composite Layer
Composite Layer
Composite Layer
2 layers
Layout
Paint Setup
Paint
Composite
Layers
Devagar
OK
Rápido
Layout
Paint Setup
Paint
Composite
Layers
Devagar
OK
Rápido
Horrivelmente lento
Lento
Rápido
Desktop Mobile
Composite Layer
.box {
opacity: 0.5;
transform: translateZ(0);
// ...
}
cria nossa Composite Layer
Composite Layer
.box {
opacity: 0.5;
transform: translate3d(0, 0, 0);
// ...
}
cria nossa Composite Layer
Composite Layer
.box {
opacity: 0.5;
transform: translate3d(0, 0, 0);
// ...
}
cria nossa Composite LayerHACK
Composite Layer
.box {
opacity: 0.5;
will-change: opacity;
// ...
}
bit.ly/will-change-prop
Composite Layer
opacity scale
translate rotate
JavaScript
Layout Trashing
Layout Trashing
clientHeight, offsetTop, height, width, scrollTo...
Isso obriga o browser a recalcular todo o layout
Layout Trashing
clientHeight, clientLeft, clientTop, clientWidth, focus(),
getBoundingClientRect(), getClientRects(), innerText,
offsetHeight, offsetLeft, offsetParent, offsetTop,
offsetWidth, outerText, scrollByLines(), scrollByPages(),
scrollHeight, scrollIntoView(), scrollIntoViewIfNeeded(),
scrollLeft, scrollTop, scrollWidth, height, width,
getBoundingClientRect(), getClientRects(), computeCTM(),
getBBox(), getCharNumAtPosition(),
getComputedTextLength(), getEndPositionOfChar(),
getExtentOfChar(), getNumberOfChars(),
getRotationOfChar(), getStartPositionOfChar(),
getSubStringLength(), selectSubString(), instanceRoot,
getComputedStyle(), scrollBy(), scrollTo(), scrollX,
scrollY, webkitConvertPointFromNodeToPage(),
webkitConvertPointFromPageToNode()
bit.ly/layout-trashing-js
Performance em animações
Referências
bit.ly/css-prop-operations
bit.ly/runtime-perf
bit.ly/mobile-perf-auditing
bit.ly/high-perf-anim
Obrigado!
@hugobessaa

More Related Content

PDF
COSTRUIRE INTERFACCE WEB UTILIZZANDO REACTJS (Gabriele Petronella)
PDF
Sviluppo di interfacce web con React.JS
PDF
110623 ra how to map network drive
PDF
Partial Application in Javascript (and why I like it)
PDF
Webkit Transitions. The Good, The Bad, & The Awesome
KEY
The Canvas Tag
KEY
5 tips for your HTML5 games
PDF
Automating Large Applications on Modular and Structured Form with Gulp
COSTRUIRE INTERFACCE WEB UTILIZZANDO REACTJS (Gabriele Petronella)
Sviluppo di interfacce web con React.JS
110623 ra how to map network drive
Partial Application in Javascript (and why I like it)
Webkit Transitions. The Good, The Bad, & The Awesome
The Canvas Tag
5 tips for your HTML5 games
Automating Large Applications on Modular and Structured Form with Gulp

Similar to Performance em animações (20)

KEY
HTML5, CSS3, and other fancy buzzwords
PDF
CSS Less framework overview, Pros and Cons
PDF
I Can't Believe It's Not Flash
PDF
Google's HTML5 Work: what's next?
PDF
Accelerated Stylesheets
PPTX
Getting Visual with Ruby Processing
PDF
Css3 transitions and animations + graceful degradation with jQuery
PPTX
HTML5 - A Whirlwind tour
PDF
mloc.js 2014 - JavaScript and the browser as a platform for game development
PDF
Web Presentations, deck.js and Extensions
PPT
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
PPTX
CSS3 For WebKit: iPadDevCamp Presentation
PPTX
Looking glassrenderinglt en
PDF
Keep calm and let's play CSS3
ODP
Css3 101
PPTX
Doing More With Less
PDF
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG
PDF
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
PDF
Slides mihail-ivanchev-1
PDF
Building a Visualization Language
HTML5, CSS3, and other fancy buzzwords
CSS Less framework overview, Pros and Cons
I Can't Believe It's Not Flash
Google's HTML5 Work: what's next?
Accelerated Stylesheets
Getting Visual with Ruby Processing
Css3 transitions and animations + graceful degradation with jQuery
HTML5 - A Whirlwind tour
mloc.js 2014 - JavaScript and the browser as a platform for game development
Web Presentations, deck.js and Extensions
Frostbite Rendering Architecture and Real-time Procedural Shading & Texturing...
CSS3 For WebKit: iPadDevCamp Presentation
Looking glassrenderinglt en
Keep calm and let's play CSS3
Css3 101
Doing More With Less
JavaOne 2009 - 2d Vector Graphics in the browser with Canvas and SVG
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Slides mihail-ivanchev-1
Building a Visualization Language
Ad

Recently uploaded (20)

PDF
Architecture types and enterprise applications.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Hybrid model detection and classification of lung cancer
PPT
Geologic Time for studying geology for geologist
PDF
Unlock new opportunities with location data.pdf
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Modernising the Digital Integration Hub
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPT
What is a Computer? Input Devices /output devices
PDF
STKI Israel Market Study 2025 version august
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Five Habits of High-Impact Board Members
Architecture types and enterprise applications.pdf
Zenith AI: Advanced Artificial Intelligence
Taming the Chaos: How to Turn Unstructured Data into Decisions
Hybrid model detection and classification of lung cancer
Geologic Time for studying geology for geologist
Unlock new opportunities with location data.pdf
Web Crawler for Trend Tracking Gen Z Insights.pptx
A comparative study of natural language inference in Swahili using monolingua...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Modernising the Digital Integration Hub
1 - Historical Antecedents, Social Consideration.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
O2C Customer Invoices to Receipt V15A.pptx
What is a Computer? Input Devices /output devices
STKI Israel Market Study 2025 version august
Developing a website for English-speaking practice to English as a foreign la...
Hindi spoken digit analysis for native and non-native speakers
Univ-Connecticut-ChatGPT-Presentaion.pdf
Chapter 5: Probability Theory and Statistics
Five Habits of High-Impact Board Members
Ad

Performance em animações