Making It Better Without Making It Over (Front Porch)

Making It Better Without Making It Over (Front Porch)

0177cdce6af15e10db15b6bf5dc4e0b0?s=128

Rebecca Murphey

October 25, 2016
Tweet

Transcript

  1. Making It Better 
 Without Making It Over Rebecca Murphey

    @rmurphey Front Porch Dallas / October 2016
  2. None
  3. None
  4. None
  5. None
  6. None
  7. 2007

  8. None
  9. None
  10. None
  11. None
  12. None
  13. None
  14. None
  15. None
  16. None
  17. None
  18. None
  19. None
  20. None
  21. None
  22. None
  23. 0 5000 10000 15000 20000 2008 2009 2010 2011 2012

    2013 2014 2015 2016 2016.8 JS Lines of Code
  24. Choose-your-
 own-adventure
 architecture

  25. None
  26. It’s easy to feel 
 like the only way 


    to make things better 
 is to start over.
  27. None
  28. a single, central source of state

  29. None
  30. None
  31. 40 arguments

  32. None
  33. 2 arguments shared models

  34. guardrails

  35. None
  36. None
  37. None
  38. crafting our deployment a new understanding of performance

  39. None
  40. None
  41. Easy Math T = time S = payload size W

    = bandwidth (bytes/s) S = 78K W = 1500K/s T = S / W = 52ms
  42. But latency … Data must travel from client to server

    and back.
  43. 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
  44. But TCP setup … One round trip for the server

    and client to say hello.
  45. 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
  46. But TCP slow start … A server starts by sending

    only a few packets of data, increasing the “congestion window” as packets are acknowledged.
  47. 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
  48. Easy Math T = time S = payload size W

    = bandwidth (bytes/s) S = 78K W = 1500K/s T = S / W = 52ms
  49. 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
  50. None
  51. None
  52. 14.6K 43.8K 102.2K

  53. 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
  54. 43.8K Maximum file size to ensure only 2 round trips

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

    
 on a new connection.
  56. which workflows matter most? where are the bytes coming from?

    how can we hold the line after improving?
  57. None
  58. Framework or no, 
 JS growth & complexity 
 is

    unbounded 
 without constraints.
  59. Education is 
 a powerful enabler 
 of improvement.

  60. 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
  61. Every technology decision is eventually regrettable.

  62. Building 
 for the web
 is better today.

  63. I help
 people
 get jobs. @rmurphey rmurphey.com