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

Back to Front Performance - Oct 2013

Back to Front Performance - Oct 2013

Breaking Borders, Reading, 15 October 2013

Drew McLellan

October 15, 2013
Tweet

More Decks by Drew McLellan

Other Decks in Programming

Transcript

  1. Back to Front
    Performance.
    Breaking Borders 15 Oct 2013
    @drewm

    View full-size slide

  2. Back to Front
    Performance.
    Breaking Borders 15 Oct 2013
    @drewm

    View full-size slide

  3. Performance is a feature.

    View full-size slide

  4. The Steve Souders
    Problem.

    View full-size slide

  5. 256MB
    10MB
    <25

    View full-size slide

  6. Performance under load
    depends on the time taken
    to process each request.

    View full-size slide

  7. The Back End.

    View full-size slide

  8. Cheap hosting
    is expensive.

    View full-size slide

  9. Shared hosting
    is the worst.

    View full-size slide

  10. Consider what your
    project cost to build when
    buying hosting.

    View full-size slide

  11. Use the best hosting you
    can afford, not the
    cheapest you can get away
    with.

    View full-size slide

  12. Hot Girls Love Hosting!

    View full-size slide

  13. SELECT c.catTitle, COUNT(c2p.catID) as qty
    FROM tblBlogCategories c,
    tblBlogPost_Categories c2p
    WHERE c.catID=c2p.catID
    GROUP BY c.catID
    ORDER BY qty DESC

    View full-size slide

  14. How real-time is this data?

    View full-size slide

  15. Do the work once.

    View full-size slide

  16. Premature optimization is
    the root of all evil.

    View full-size slide

  17. There is no doubt that the grail of
    efficiency leads to abuse. Programmers
    waste enormous amounts of time thinking
    about, or worrying about, the speed of
    noncritical parts of their programs, and
    these attempts at efficiency actually have
    a strong negative impact when debugging
    and maintenance are considered.
    We should forget about small efficiencies,
    say about 97% of the time: premature
    optimization is the root of all evil.

    View full-size slide

  18. Yet we should not pass up our opportunities
    in that critical 3%. A good programmer will
    not be lulled into complacency by such
    reasoning, he will be wise to look carefully
    at the critical code; but only after that code
    has been identified.

    View full-size slide

  19. The fear of premature
    optimization is the root of
    all evil.

    View full-size slide

  20. Let’s make programming
    fun!

    View full-size slide

  21. Insanity is doing the same
    thing over and over again
    and expecting
    different results.

    View full-size slide

  22. The Network.

    View full-size slide

  23. www.varnish-cache.org

    View full-size slide

  24. Divide resources across
    domain names.

    View full-size slide

  25. s1.example.com s1.example.com s2.example.com s2.example.com
    s3.example.com s3.example.com s4.example.com s4.example.com

    View full-size slide

  26. example.com s*.example.com
    Apache nginx
    application static assets

    View full-size slide

  27. ExpiresActive on
    ExpiresByType image/jpg "access plus 7 days"
    ExpiresByType image/gif "access plus 7 days"
    ExpiresByType image/jpeg "access plus 7 days"
    ExpiresByType image/png "access plus 7 days"
    ExpiresByType text/css "access plus 7 days"
    ExpiresByType application/javascript
    "access plus 7 days"
    ExpiresDefault "access plus 10 years"

    View full-size slide

  28. AddOutputFilterByType DEFLATE
    text/html
    text/plain
    text/xml
    text/css
    text/javascript
    application/javascript
    www.whatsmyip.org/http-compression-test/

    View full-size slide

  29. mod_pagespeed

    View full-size slide

  30. The Front End.

    View full-size slide

  31. github/ded/script.js/
    stevesouders.com/controljs/
    developers.google.com/loader/

    View full-size slide

  32. *
    * decknetwork.net
    24ways.org/201106

    View full-size slide

  33. Steve Souders + Books
    stevesouders.com
    Yahoo! Exceptional Performance
    developer.yahoo.com/performance/

    View full-size slide

  34. The Message.

    View full-size slide

  35. The End.
    Drew McLellan
    allinthehead.com / @drewm
    Thanks, borderbreakers!

    View full-size slide