Slide 1

Slide 1 text

Making It Better 
 Without Making It Over Rebecca Murphey @rmurphey Front Porch Dallas / October 2016

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

2007

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

0 5000 10000 15000 20000 2008 2009 2010 2011 2012 2013 2014 2015 2016 2016.8 JS Lines of Code

Slide 24

Slide 24 text

Choose-your-
 own-adventure
 architecture

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

It’s easy to feel 
 like the only way 
 to make things better 
 is to start over.

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

a single, central source of state

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

40 arguments

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

2 arguments shared models

Slide 34

Slide 34 text

guardrails

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

crafting our deployment a new understanding of performance

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

Easy Math T = time S = payload size W = bandwidth (bytes/s) S = 78K W = 1500K/s T = S / W = 52ms

Slide 42

Slide 42 text

But latency … Data must travel from client to server and back.

Slide 43

Slide 43 text

Latency T = time S = payload size W = bandwidth (bytes/s) P = one-way transmission time (ping) S = 78K W = 1500K/s P = 75ms T = (2 * P) + S / W = 202ms

Slide 44

Slide 44 text

But TCP setup … One round trip for the server and client to say hello.

Slide 45

Slide 45 text

TCP Setup T = time S = payload size W = bandwidth (bytes/s) P = one-way transmission time (ping) RTT = round-trip time (2 * P) S = 78K W = 1500K/s P = 75ms RTT = 2 * P = 150ms T = (2 * RTT) + S / W = 352ms

Slide 46

Slide 46 text

But TCP slow start … A server starts by sending only a few packets of data, increasing the “congestion window” as packets are acknowledged.

Slide 47

Slide 47 text

TCP Setup T = time S = payload size W = bandwidth (bytes/s) P = one-way transmission time (ping) RTT = round-trip time (2 * P) C = congestion window (bytes) R = number of round trips S = 78K W = 1500K/s P = 75ms C = 14.6K RTT = 2 * P = 150ms R = ceil( log_2( (S / C) + 1) ) = 3 T = ( RTT * (1 + R) ) + S / W = 652ms - excludes DNS lookup for initial request to a host - assumes instantaneous server response, no packet loss, 
 and lots of other things

Slide 48

Slide 48 text

Easy Math T = time S = payload size W = bandwidth (bytes/s) S = 78K W = 1500K/s T = S / W = 52ms

Slide 49

Slide 49 text

Reality T = time S = payload size W = bandwidth (bytes/s) P = one-way transmission time (ping) RTT = round-trip time (2 * P) C = congestion window (bytes) R = number of round trips S = 78K W = 1500K/s P = 75ms C = 15K RTT = 2 * P = 150ms R = ceil( log_2( (S / C) + 1) ) = 3 T = ( RTT * (1 + R) ) + S / W = 652ms - excludes DNS lookup for initial request to a host - assumes instantaneous server response

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

14.6K 43.8K 102.2K

Slide 53

Slide 53 text

1K T = time S = payload size W = bandwidth (bytes/s) P = one-way transmission time (ping) RTT = round-trip time (2 * P) C = congestion window (bytes) R = number of round trips 1K file size 75ms ping 15K congestion window 1500K/s bandwidth RTT = 150 R = 1 T = ( 150 * (1 + R) ) + 1 = 301ms

Slide 54

Slide 54 text

43.8K Maximum file size to ensure only 2 round trips on a new connection.

Slide 55

Slide 55 text

14.6K Maximum file size to ensure only 1 round trip 
 on a new connection.

Slide 56

Slide 56 text

which workflows matter most? where are the bytes coming from? how can we hold the line after improving?

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

Framework or no, 
 JS growth & complexity 
 is unbounded 
 without constraints.

Slide 59

Slide 59 text

Education is 
 a powerful enabler 
 of improvement.

Slide 60

Slide 60 text

It’s unrealistic for you […] 
 to learn a framework 
 that solves a problem 
 you’ve never experienced. 
 Tessa Thornton,
 How to Learn Web Frameworks https://medium.com/shopify-ux/how-to-learn-web-frameworks-9d447cb71e68

Slide 61

Slide 61 text

Every technology decision is eventually regrettable.

Slide 62

Slide 62 text

Building 
 for the web
 is better today.

Slide 63

Slide 63 text

I help
 people
 get jobs. @rmurphey rmurphey.com