#towebperf meetup - Kick-off: Web Performance 101

41
#towebperf KICK-OFF WEB PERF GROUP (Front-End) Web Performance 101 November 28, 2013

description

More info here: http://www.meetup.com/Toronto-Web-Performance-Group/events/145744652/

Transcript of #towebperf meetup - Kick-off: Web Performance 101

Page 1: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

KICK-OFF WEB PERF GROUP

(Front-End) Web Performance 101November 28, 2013

Page 2: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

AGENDA !

HOUSE KEEPING NOTES (FRONT-END) 101 WEB PERFORMANCE

Q&A AND NETWORKING

Page 3: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

THANKS TO….

Page 4: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

ORGANIZERS

@bbinto @blakecrosby

Page 5: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

TWEET!

@towebperf

Page 6: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

ONE OF MANY

Page 7: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

OTHER WEB PERF EVENTS AND SOCIAL MEDIA

• Other Web Perf meetups

• Velocity conferences

• #webperf and #perfmatters

• W3C http://lists.w3.org/Archives/Public/public-web-perf/

Page 8: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

WHY IS THERE A NEED FOR SPEED?

Page 9: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

Page 10: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

Houston’s airport: customer complaints

It takes so long....grrrrr

6x

All good, bla bla...

6x

Page 11: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

Overestimating wait times for rides

Hidden lineups

Page 12: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

S L O W

Perception of Speed

Unpleasant

Unknown

Boring

Task is successful

Responsive system

FAST

Informed about progress

Page 13: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

–Brad Frost

“Ultimately performance is about respect”

BRAD FROST

Page 14: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

SOME FACTS• 39% say speed is more important than

functionality for most websites

• 8 out of 10 people will not return to a site after a disappointing experience

• Web site performance is second only to security in user expectations

Page 15: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

QUIZ!

http://channel9.msdn.com/Events/BuiId/2012/3-132

Page 16: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

YUI

Total Size (k)

Number Elements

CSS Rules

Image Files

Script Lines (F)

Script Libraries

Site #1 3,697 1,504 1,392 41 77,768

Site #2 2,278 1,100 5,325 29 39,183

Site #3 1,061 2,673 1,105 66 12,643

Site #4 1,812 4,252 1,672 12 10,284

Site #5 1,372 900 3,902 6 38,269

jQuery Prototype ExtJS Other Scriptaculous

WHICH IS THE FASTEST WEBSITE?

Page 17: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

YUI

Total Size (k)

Number Elements

CSS Rules

Image Files

Script Lines (F)

Script Libraries

Site #1 3,697 1,504 1,392 41 77,768

Site #2 2,278 1,100 5,325 29 39,183

Site #3 1,061 2,673 1,105 66 12,643

Site #4 1,812 4,252 1,672 12 10,284

Site #5 1,372 900 3,902 6 38,269

jQuery Prototype ExtJS Other Scriptaculous

WHICH IS THE FASTEST WEBSITE?

Page 18: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

YUI

Total Size (k)

Number Elements

CSS Rules

Image Files

Script Lines (F)

Script Libraries

Site #1 3,697 1,504 1,392 41 77,768

Site #2 2,278 1,100 5,325 29 39,183

Site #3 1,061 2,673 1,105 66 12,643

Site #4 1,812 4,252 1,672 12 10,284

Site #5 1,372 900 3,902 6 38,269

jQuery Prototype ExtJS Other Scriptaculous

WHICH IS THE SLOWEST WEBSITE?

Page 19: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

YUI

Total Size (k)

Number Elements

CSS Rules

Image Files

Script Lines (F)

Script Libraries

Site #1 3,697 1,504 1,392 41 77,768

Site #2 2,278 1,100 5,325 29 39,183

Site #3 1,061 2,673 1,105 66 12,643

Site #4 1,812 4,252 1,672 12 10,284

Site #5 1,372 900 3,902 6 38,269

jQuery Prototype ExtJS Other Scriptaculous

WHICH IS THE SLOWEST WEBSITE?

Page 20: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

BREAKDOWN

Page 21: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

HOW DO YOU MEASURE PERFORMANCE?

Page 22: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

MANUALLY

• View waterfall in your browser

http://www.webperformancetoday.com/2010/07/09/waterfalls-101/

Page 23: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

MANUALLY

http://www.webperformancetoday.com/2010/07/09/waterfalls-101/

Page 24: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

MANUALLY

• webpagetest.org (Demo)

• http://www.webpagetest.org/result/131127_7M_16HP/

• http://www.webpagetest.org/result/131127_ZT_16RA/

• Compare to httparchive.org (Demo)

Page 25: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

TOOLS

HAR

DIY / Browser Plugins Automatic Tools

(APIs)(APIs)

more...

Page 26: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

AUTOMATICALLYSynthetic Testing Real User Monitoring

You run the test User runs the test

Measures experience of exact one selected configuration

Measures experience of “actual user”(peace of mind). You get to know your user better

Establish baseline performance level Get concrete information about user’s latency, bandwidth, page load time

Toolsprivate/public WebPagetest (API), PageSpeed (API),

phantomJS, commercial products etc.

Toolsboomerang.js, Google Analytics, commercial

products etc.

Page 27: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

GOLDEN RULES

• https://developers.google.com/speed/

• http://developer.yahoo.com/performance/rules.html

Page 28: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

GLOBAL SHELL• Shared by all

• Visual representation

• Non-visual representation

• SSI variables in header to serve ads and tracking

• Global scripts, 3rd party scripts and stylesheets

Page 29: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

IMPROVEMENT (IS SOMETIMES EASIER THAN YOU THINK?)

• Re-factored code: Removed old/un-used code

• Moved some scripts to the bottom of page

• Minified and concatenated scripts and CSS files to reduce file size and HTTP requests

Page 30: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

GLOBAL SHELL

Page 31: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

68

69.4

70.8

72.2

73.6

75

Page Weight (kB)

69.8

71.9

0

0.25

0.5

0.75

1

Start to render (s)

0.691

0.942

EXAMPLESGlobal Shell: Before and after

0

6

12

18

24

HTTP Requests

18

24Before After

25% 3%

26%0

0.325

0.65

0.975

1.3

Visually complete (s)

0.9

1.3

30%

Page 32: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

AUTOMATION

• Why optimizing manually if you can automate it?

• Included performance optimization into your deployment and release process

Page 33: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

AUTOMATED & BUILT-IN TOOLS

• Maven, Ant Tools and Plugins

• Closure Compiler (Google)

• Minify-maven-plugin

• HTMLCompressor

• Confess

• cssembed.jar or compass for data:uri

Page 34: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

AUTOMATED & BUILT-IN TOOLS

• If you can’t / don’t want to use Maven / Ant

• You should use taskrunners and scaffolding: Grunt, Yeoman

• Continuous integration (e.g SPOFcheck, yslow)

Page 35: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

TIPS

Page 36: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

– Christian Heilmann, The Vanilla Web Diet

“It’s not about what you can add, it’s about what you can’t take away”

Page 37: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

START MEASURING AND LOGGING YOUR PERFORMANCE

Page 38: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

SERVE ONLY WHAT THE CLIENT NEEDSDevice Detection, Server-side components and

Responsive Web Design

Page 39: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

SET A PERFORMANCE BUDGET

Page 40: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

NEXT MEETUP?

Feedback Form: http://bit.ly/towebperf-1

Page 41: #towebperf meetup - Kick-off: Web Performance 101

#towebperf

THANK YOU!AND NOW? LET’S TALK!