26. Rendering is parsing
render
HTML DOM TREE
<html> - document
<head> - elem: html
<title>Title</title> - elem: head
- elem: title
</head> - text: Title
<body> - elem: body
<div>This is a Text</div> - elem: div
<div id="hidden">Hidden</div> - text: This is a Text
- elem: div
- attr: id=hidden
- text: Hidden
CSS STYLE STRUCT
- selector: body
rule:
body { display: block # default css
padding: 0; padding-bottom: 0px # site css
} padding-left: 0px # site css
padding-right: 0px # site css
#hidden { padding-top: 0px # site css
display: none; - selector: hidden
} rule:
display: none # site css
27. Rendering is layout
render
DOM TREE
reflow
- document
- elem: html
- elem: head
- elem: title
- text: Title
- elem: body
- elem: div RENDER TREE
- text: This is a Text
- elem: div
- attr: id=hidden - root
- text: Hidden
- body
- block
STYLE STRUCT - inline: This is
- inline: a Text
- selector: body
rule:
display: block # default css
padding-bottom: 0px # site css
padding-left: 0px # site css
padding-right: 0px # site css
padding-top: 0px # fsite css
- selector: hidden
rule:
display: none # site css
28. Rendering is painting
render
RENDER TREE re p a in t
This is
- root
a Text
- body
- block
- inline: This is
- inline: a Text
29. Rendering is execution
render
INPUT
EVENT QUEUE
mouse moved
mouse pressed
mouse released
OS key pressed
key released
30. Execution in one thread
render
mouse moved EVENT QUEUE
mouse pressed
mouse released
key pressed
key released
Javascript Native
Browser
Execution Action
31. Once upon a time...
Static pages
Few resources
Less javascript
32. Most time on server
domain connect send receive render
84. … but we are at a
Drupal Camp!
http://wimleers.com/article/improving-drupals-page-loading-performance
85. Drupal does
CSS/Js Aggregation
Expire headers
GZIP compression (content)
Move CSS on top
Avoid redirects
http://wimleers.com/article/improving-drupals-page-loading-performance
86. Drupal should
Move Js on bottom
Reduce DNS lookup
http://wimleers.com/article/improving-drupals-page-loading-performance
87. Drupal can't
Compress/Minify JS/CSS
Manage Etags
Manage Expire per URL
GZIP per format
http://wimleers.com/article/improving-drupals-page-loading-performance