Painting process
A repaint occurs when changes are made to an elements skin that changes visibility, but do not affect its layout.
A reflow is even more critical to performance because it involves changes that affect the layout of a portion of the page (or the whole page).
https://csstriggers.com
http://pixeln3rd.github.io/cssreflow/
This code will prompts browser to re-render 5 times
jQuery('#dialog-window')
.width(600)
.height(400)
.css('position':'absolute')
.css('top', '200px')
.css('left', '200px');
Suggest to refactor as below
.your-style {
width: 600px;
height: 400px;
position: absolute;
top: 200px;
left: 200px;
}jQuery('#dialog-window')
.addClass('your-style');document.getElementsByTagName('*').lengthYahoo homepage has 700 elements
Test your heavy dom
https://vn.yahoo.com/?p=usCase studies
Airbnb Infinity
Clusterize.js
Minification and concatenation
Text
https://www.npmjs.com/package/gulp-concatCSS Sprites
background-image
background-positionText
Using CDN
Gzip Components
Accept-Encoding: gzip, deflate
Content-Encoding: gzipPut Stylesheets at the top
Put Scripts at the bottom
http://taligarsiel.com/Projects/howbrowserswork1.htm
http://desalasworks.com/article/javascript-performance-techniques/
https://developer.yahoo.com/performance/rules.html