+ All Categories
Home > Technology > BraziJS 2013 - Performance as a Feature

BraziJS 2013 - Performance as a Feature

Date post: 27-Jan-2015
Category:
Upload: marcel-duran
View: 104 times
Download: 0 times
Share this document with a friend
Description:
 
Popular Tags:
54
@marcelduran Performance as a Feature
Transcript
Page 1: BraziJS 2013 - Performance as a Feature

@marcelduran

Performance as a Feature

Page 2: BraziJS 2013 - Performance as a Feature

tri afudê tchê

Page 3: BraziJS 2013 - Performance as a Feature

about me

Page 4: BraziJS 2013 - Performance as a Feature

web-perf

Page 5: BraziJS 2013 - Performance as a Feature

features

Page 6: BraziJS 2013 - Performance as a Feature

losing features

omg!

Page 7: BraziJS 2013 - Performance as a Feature

losing performance

before after

Page 8: BraziJS 2013 - Performance as a Feature

what does performance mean?

Page 9: BraziJS 2013 - Performance as a Feature

how to lose performance

new feature

bugfix

omg!

new release

Page 10: BraziJS 2013 - Performance as a Feature

typicaldev cycle

build

users

deploy

test

monitor

reactive

Page 11: BraziJS 2013 - Performance as a Feature

rum

new release

Page 12: BraziJS 2013 - Performance as a Feature

continuous integration

Page 13: BraziJS 2013 - Performance as a Feature

continuous integration

acceptanceregression

smokeintegrationunit

ninjachuck norris

Page 14: BraziJS 2013 - Performance as a Feature
Page 15: BraziJS 2013 - Performance as a Feature

continuous integration

Page 16: BraziJS 2013 - Performance as a Feature

branches * (new features + bugfixes)

Page 17: BraziJS 2013 - Performance as a Feature

looking for performance regression

previous

diff

new

Page 18: BraziJS 2013 - Performance as a Feature

yslow.org

Page 19: BraziJS 2013 - Performance as a Feature

har

{ "log": { "version": "1.1", "pages": [ { "startedDateTime": "2012-08-16T18:27:29.000+00:00", "id": "page_1_0", "pageTimings": { "onLoad": 13701, . . .

Page 20: BraziJS 2013 - Performance as a Feature

generating har

Page 21: BraziJS 2013 - Performance as a Feature

$ npm install yslow -g

Page 22: BraziJS 2013 - Performance as a Feature

+ +

Page 23: BraziJS 2013 - Performance as a Feature

yslow + phantomjs

$ phantomjs yslow.js http://yslow.org

Page 24: BraziJS 2013 - Performance as a Feature

new test output formats

-f, --format <format>

( json | xml | plain | tap | junit )

Page 25: BraziJS 2013 - Performance as a Feature

test specs

-t, --threshold <score>( [0-100] | [A-F] | {json} )

default: 80

Page 26: BraziJS 2013 - Performance as a Feature

test specs examples

-t B-t 75-t '{"overall": "C", "ycdn": "F"}'-t '{"ycdn": "F", "yexpires": 75}'

Page 27: BraziJS 2013 - Performance as a Feature

browser impersonation

-u, --ua "<user agent>"

e.g: -u "Mozilla/5.0 (iPhone; ...)"

-vp, --viewport <WxH>

e.g: -vp 320x480

Page 28: BraziJS 2013 - Performance as a Feature

authentication

-ch, --headers <JSON>

e.g: -ch '{"Cookie": "auth_token=foo"}'

Page 29: BraziJS 2013 - Performance as a Feature

exempli gratia

$ phantomjs yslow.js http://twitter.com--info grade --format tap

-t '{"overall": "B", "ycdn": "F"}'-ch '{"Cookie": "auth_token=foo"}'

Page 30: BraziJS 2013 - Performance as a Feature

jenkins

Page 31: BraziJS 2013 - Performance as a Feature

+wpo build test

deploymonitor users

wpo

proactive

Page 32: BraziJS 2013 - Performance as a Feature

high performance

A A A A ...

Page 33: BraziJS 2013 - Performance as a Feature

what's your metric?

page load

domReady

TTFBstart render

TTF

speed indexAFTfoobar

Page 34: BraziJS 2013 - Performance as a Feature

TTFT

TTFT

Page 35: BraziJS 2013 - Performance as a Feature

RESTful API

XML

JSON

Page 36: BraziJS 2013 - Performance as a Feature

marcelduran.com/webpagetest-api

Page 37: BraziJS 2013 - Performance as a Feature

webpagetest-api wrapper overview

http://webpagetest.org/testStatus.php?test=121119_DJ_J0R

var WebPageTest = require('webpagetest'), wpt = new WebPageTest();

wpt.getTestStatus('121119_DJ_J0R', function(err, data) { console.log(err || data);});

$ webpagetest status 121119_DJ_J0R

http://webpagetest.aws.af.cm/status/121119_DJ_J0R

Page 38: BraziJS 2013 - Performance as a Feature

commands

statusresultslocationstesterstestcancelharpagespeed

utilizationrequesttimelinenetlogconsoletestinfowaterfallscreenshot

Page 39: BraziJS 2013 - Performance as a Feature

options

serveraftbodiesfirstfullignoresslkeepuanetlognoadsnoheaders

noimagesnooptnoscriptonloadprivatesensitivestandardstimelinevideoauth

typeblockbwdowntcpdumpbwupconnectionsconnectivitydomdurationjpegkey

labellatencylocationloginnotifypasswordpingbackplrrequestrunsspof

Page 40: BraziJS 2013 - Performance as a Feature

webpagetest architecture

location alpha

WPT server

age 1nt

age 2nt

age 3nt

location beta

age 1nt

age 2nt

age 3nt

any work for me? (polling)

test done! your results (post)

test foo.com

test

bar

.com

any work for me? (polling)

test done! your results (post)

via user

via api

Page 41: BraziJS 2013 - Performance as a Feature

testing then polling results

$ webpagetest test twitter.com

{ ..., "testId": "121119_DJ_J0R", ... }

$ webpagetest results 121119_DJ_J0R

{ ..., "statusText": "Test Started", ... }

$ webpagetest results 121119_DJ_J0R

{ ..., "loadTime": 1810, ... }

Page 42: BraziJS 2013 - Performance as a Feature

polling workflow

some location

WPT server

age 1nt

age 2nt

age 3nt

some server

test foo.com

1te

st ID

=123

2 any work for me?yes foo.com

4

test foo.com5

test 123 done!results (post)

6

give me details of test 123

7

test

123

don

e?

3

Page 43: BraziJS 2013 - Performance as a Feature

pingback workflow

some location

WPT server

age 1nt

age 2nt

age 3nt

some server

test foo.com

1te

st ID

=123

2 any work for me?yes foo.com

3

test foo.com4

test 123 done!results (post)

5

test

123

don

e!

6

give me details of test 123

7

Page 44: BraziJS 2013 - Performance as a Feature

sync test

$ webpagetest test twitter.com --poll

{ ..., "loadTime": 1810, ... }

{ ..., "loadTime": 1810, ... }

$ webpagetest test twitter.com --wait

Page 45: BraziJS 2013 - Performance as a Feature

performance test specs

{ "response": { ... "data": { ... "median": { "firstView": { ... "requests": 15 "render": 500, "loadTime": 2500, "score_gzip": 70 ... } } } ... }}

wpt results

{ "median": { "firstView": { "requests": 20 "render": 400, "loadTime": 3000, "score_gzip": { "min": 90 } } }}

specs

testspecs.json

Page 46: BraziJS 2013 - Performance as a Feature

performance test specs

$ webpagetest test example.com --poll --spec testspecs.json

WebPageTest ✓ median.firstView.requests: 15 should be less than 20 1) median.firstView.render: 500 should be less than 400 ✓ median.firstView.loadTime: 2500 should be less than 3000 2) median.firstView.score_gzip: 70 should be greater than 90

2 passing (3 ms) 2 failing

2

$ echo $?

Page 47: BraziJS 2013 - Performance as a Feature

wpt perf test specspowered by

Page 48: BraziJS 2013 - Performance as a Feature

performance test reporters

dot (default)

spec

tap

xunit

list

progress

min

nyan

landing

json

doc

markdown

teamcity

Page 49: BraziJS 2013 - Performance as a Feature

continuous integration+ performance

bit.ly/wpt-jenkins bit.ly/wpt-travis bit.ly/wpt-drone

bit.ly/wpt-ci

Page 50: BraziJS 2013 - Performance as a Feature

continuous performance measurement

pre prod

branches: foo + bar + baz

foo

bar

baz

Page 51: BraziJS 2013 - Performance as a Feature

continuous performance measurement

Page 52: BraziJS 2013 - Performance as a Feature

build test

deploy

monitor

wpo

perf

users

proactive

+perf

webpagetest

Page 53: BraziJS 2013 - Performance as a Feature

fim

Page 54: BraziJS 2013 - Performance as a Feature

image creditsChimarrão: terramate.com.brSpeed gauge: WebIconSet.comYahoo logo: YOOtheme.comFlower: linux.softpedia.com/developer/Oliver-Scholtz-93.htmlBandaid: nahas-pro.deviantart.comGuinea pig: en.academic.ru/dic.nsf/enwiki/2191230Needle: business2community.com/social-media/4-tips-for-converting-social-media-leads-0144554Ninja: Iconka.comSad Face: memegenerator.netFork: fortawesome.github.io/Font-AwesomeOthers: iconfinder.com


Recommended