Desenvolver aplicações web requer que você entenda seus usuários e o que eles precisam, mas também requer que você entenda como o Browser funciona, como seu conteúdo é entregue e exibido aos usuários. Dessa forma, você fornece uma boa experiência com performance apropriada. Nesta palestra introduziremos os conceitos presentes no campo de Web Performance Optimization, desde as requisições de rede, passando pela sequência de passos utilizados pelos Browsers para converter e executar os conteúdos (HTML, Javascript e CSS), definir o layout e, por fim, exibir as informações.
Report
Share
Report
Share
1 of 31
Download to read offline
More Related Content
Critical Rendering Path - Velocidade também é uma funcionalidade
1. Critical Rendering Path
Velocidade também é uma funcionalidade
João Lucas P Santana
jlucasps@gmail.com
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
2. Percepção de velocidade
http://goo.gl/JPG1WP, http://goo.gl/WYF7j
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
3. Critical Rendering Path
Network
HTML
CSS
DOM
JavaScript Render
CSSOM
Tree Layout Paint
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
5. Characters Tokens Nodes DOM
<html>
<head>
<title>DEVDAY 2014</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="assets/style.css">
</head>
<body>
<header>
<a href="http://devday.devisland.com" target="_blank">#DEVDAY2014</a>
</header>
<section>
<h2>DEVDAY 2014 @ BH/Br</h2>
<img src="assets/devday2013.png">
<h3>Critical Rendering Path</h3>
</section>
</body>
</html>
StartTag: html StartTag: head
StartTag: title DEVDAY 2014
EndTag: title Tag: meta
Tag: link EndTag: head
StartTag: body StartTag:
header
StartTag: a #DEVDAY2014
http://goo.gl/6ptLCJ
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
6. Tokenizer
Tree
builder
Construindo o DOM
3c 68 74 6d 6c 3e 3c 68 65 61 64 3e 3c 74 69 74 6c 65 3e 44 45 56 44 41 59 65 ...
Characters <html><head><title>DEVDAY 2014</title><meta..><link..></head><body><header><a href="h ...
Tokens StartTag: html StartTag: head StartTag: title ... EndTag: title Tag: meta
Nodes html head title DEVDAY2014 meta ... h2 DEVDAY 2014 @ BH/Br
DOM html
head
title meta link
body
header
a
DEVDAY 2014
#DEVDAY2014
href="assets/style.css"
type="text/css"
rel="stylesheet"
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
7. DOM - Document Object Model
parsing incremental
inicia-se ao receber os primeiros bytes
conteúdo, propriedades e
relacionamento entre os nodes
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
8. Critical Rendering Path
Network
HTML
CSS
DOM
JavaScript Render
CSSOM
Tree Layout Paint
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
14. Render Tree
DOM e CSSOM formam Render Tree
Somente nodes visíveis na página
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
15. Critical Rendering Path
Network
HTML
CSS
DOM
JavaScript Render
CSSOM
Tree Layout Paint
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
16. Layout
onde e como os elementos serão
posicionados na tela
http://goo.gl/0L9usy
↑ tamanho ou complexidade do
DOM/CSSOM
↑ tempo em Layout
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
17. need layout: 14
tree size: 14
scope: document
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
18. Critical Rendering Path
Network
HTML
CSS
DOM
JavaScript Render
CSSOM
Tree Layout Paint
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
19. Painting
tamanho da área
formato (bordas)
sombras
transparências
background-images
Render Tree Layout Paint
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
25. <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="assets/style.css">
</head>
<body>
<header> .. </header>
<section> ... <h2>DEVDAY 2014 @ BH/Br</h2> ... </section>
<script type="text/javascript" src="assets/effects.js"></script>
</body>
request
GET /
idle blocked Run JS
DOM CSSOM DOM . . .
response
GET css
GET js
response
response
http://goo.gl/d4FuxG
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
26. JavaScript
consultar e modificar DOM/CSSOM
bloqueado durante CSSOM
bloqueia construção do DOM
<script src="assets/effects.js" async></script>
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
27. Critical Rendering Path
Network
HTML
CSS
DOM
JavaScript Render
CSSOM
Tree Layout Paint
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
28. Otimizar o Critical Rendering Path
Minimizar dados
minify, compress e cache: HTML, JS e CSS
Reduzir blocking resources
media queries para CSS, async/onload para JS
Minimizar tamanho do CRP
número e ordem dos resources
http://goo.gl/BJqIvR
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
30. Referências
github.com/davidsonfellipe/awesome-wpo
Docs, Blogs, Articles, Talks, Analyzers, Benchmark, CDN, Image
Optimizers, Loaders, Minifiers, Sprite Generators, Web Performance
Meetup Groups
Ilya Grigorik, Crash Course on Web Performance
Bandwidth, latency, and radio performance - http://goo.gl/IiLJTf
Optimizing networking performance (and HTTP 2.0) - http://goo.gl/SiJ6DI
Critical rendering path - http://goo.gl/Hs5Jx2
Delivering 60 FPS in the browser - http://goo.gl/uZly5u
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps
31. Critical Rendering Path
Velocidade também é uma funcionalidade
Obrigado!
João Lucas P Santana
jlucasps@gmail.com
Critical Rendering Path - #wpo #crp #perfmatters DEVDAY 2014 @jlucasps