Top Banner
Liking performance SydJS, Oct 17, 2012
20

Liking performance

Apr 11, 2017

Download

Technology

Stoyan Stefanov
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Liking performance

Liking performance

SydJS, Oct 17, 2012

Page 2: Liking performance

https://www.facebook.com/plugins/like.php?href=…

Page 3: Liking performance

Starting: OMG!

2-3 CSS files7-8 JavaScript files

Page 4: Liking performance

Static resource packaging

1 CSS, 1 sprite, 1 JS

Page 5: Liking performance

Single CDN hostname

No domain sharding for so few resources

Page 6: Liking performance

Async JS

var js = document.createElement('script'); js.src = 'http://path/to/js'; document.getElementsByTagName('head')[0] .appendChild(js);

Page 7: Liking performance

CSS: inline, then lazy

Page 8: Liking performance

Serializing hidden content

IE still downloads images in display: none

Page 9: Liking performance

CSS "nubs"

Page 10: Liking performance

Rounded corners

<!-- IE --><b></b> <button /><b></b>

Page 11: Liking performance

Rewrite

Reducing CSS and JS

Page 12: Liking performance

All CSS inline

small enough, dynamic

Page 13: Liking performance

All images inline, reverted :(

Page 14: Liking performance

Common JS migration

var DOM = require('DOM');// …DOM.find('#something .or .other');// …module.exports = Like;

Page 15: Liking performance

Lazy JS

Some inline. Preload some more. Execute on user action.

Page 16: Liking performance
Page 17: Liking performance

Loading SDK

<script>Async JS

FIF

Page 18: Liking performance

Async JS

Page 20: Liking performance

Thank you!

@stoyanstefanov