Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Stack Overflow - it's all about performance

Stack Overflow - it's all about performance

Slides of the presentation given in November 2014 at Øredev

3fd9e5b2c59170ec3d74dde30d233fa4?s=128

Marco Cecconi

November 07, 2014
Tweet

Transcript

  1. Marco Cecconi @sklivvz http://sklivvz.com

  2. ARCHITECTURE? WHAT THE HECK IS THAT?

  3. None
  4. None
  5. Grew to 130 sites (+20%) Global site rank went from

    #56 to #44 (-12)
  6. None
  7. *source: Quantcast, Alexa #50-­‐ish  network  for  traffic*   (between imdb.com

    and t.co)
  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. http://stackexchange.com/performance

  22. Agile  

  23. BAT!CAVE Code-build-test cycle running on home machine feature requests

  24. BAT!CAVE DEV.SO Test on the real servers git push

  25. BAT!CAVE DEV.SO META.SE 1-click deploy Users test on meta.stackexchange.com (“baking”)

    git push
  26. BAT!CAVE DEV.SO META.SE 1-click deploy HALP! git revert git push

  27. BAT!CAVE DEV.SO NETWORK META.SE 1-click deploy git push 1-click deploy

    It’s live! Tons of users use it…
  28. BAT!CAVE DEV.SO NETWORK META.SE 1-click deploy git push 1-click deploy

    …and provide new feature requests
  29. Move  fast  and  break  things*   * Not the home

    page or question page :-)
  30. Move  fast  and  break  things*   * Not the home

    page or question page :-)
  31. Abusing  caching  

  32. None
  33. None
  34. None
  35. Our  frienemy:   The  Garbage  Collector  

  36. None
  37. None
  38. None
  39. None
  40. None
  41. None
  42. Cache abuse to help GC

  43. None
  44. None
  45. Compiler abuse to help GC

  46. None
  47. None
  48. None
  49. None
  50. IRepository<Order>  orderRepository  =            container.Resolve<IRepository<Order>>();  

      Order  order  =  orderRepository.Get(35); Ye olde dependency injection
  51. None
  52. IRepository<Order>  repository  =      new  ValidatingOrderRepository  (    

         new  SecurityRepository<Order>  (              new  LoggingRepository<Order>  (                  new  CachingRepository<Order>  (                      new  NHibernateRepository<Order>  ()                  )              )          )      );         Order  order  =  repository.Get(35);
  53. Our  source  code  

  54. None
  55. None
  56. None
  57. None
  58. None
  59. None
  60. YAGNI*   * You Ain’t Gonna Need It!

  61. Libraries  and  open  source  

  62. None
  63. None
  64. None
  65. Wrap  code  in  libraries     and  open  source  it

     
  66. None
  67. None
  68. “SUPERHERO” CODING

  69. None
  70. TOOLS LEVEL: “NINJA”

  71. •     Performance  is  a  feature   •     Always.

     Be.  Shipping.   •     Use  your  circumstances.   •     Open  source  your  libraries   •     3  obscenely  big  monitors.     KEY TAKEAWAYS
  72. None
  73. Marco Cecconi @sklivvz http://sklivvz.com we are hiring new ninjas from

    anywhere in the world!