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

Performance - a challenging craft

Avatar for Fabian Lange Fabian Lange
September 03, 2011

Performance - a challenging craft

In my talk at socrates 2011, I descrived why performance is a craft and what to do to ensure great performance. I concluded with a few best practies and wonder if there are more

Avatar for Fabian Lange

Fabian Lange

September 03, 2011
Tweet

More Decks by Fabian Lange

Other Decks in Technology

Transcript

  1. Customer Fabian  My day to day job is to

    help customers fixing software performance  People really struggle with performance  But most of them struggle with coding as well That‘s me  If creating good software is a craft, performance should be one as well
  2. Art  Some say: „creating software is art“  Art

    and software development need creativity
  3. Magic  Fixing performance is often considered magic  Magic

    is something  only you understand  you do in a hard to follow fashion
  4. Money (in parts of the world)  Value == Money

     We need a business case for performance  What is the impact of bad performance?
  5. Typical (?) retailer  Amazon measured the impact of 100ms

    delay  Sales dropped by 1%  In a year that would be 245 Million USD
  6. New?  Instable or slow software delays time to market

     Slow software is no longer accepted by customers
  7. Snail Mail  Insurances like to send paper via mail

     Not meeting deadlines can cause  Legal issues  Canceled contracts  Loss of money
  8. Performance Engineering  Calculate Execution Time  Code x =

    5ms  Code y = 2*x = 10ms  Know code in advance  Waterfall approach  Proving the performance of software is more difficult than proving the correct function
  9. Look closely  We prove functional correctness with automated tests

     High coverage  Run examples and see if they are fast
  10. How much load breaks the system?  Done late in

    project  If done at all  No chance to fix anything
  11. 42cm are fast?  Avoid human errors  Require machine

    decidable fail / pass check  What is the measure?
  12. Our Environment  Functionality is independent of the environment 

    Performance characteristics can vary  Unusable slow  Lightning fast
  13. Developers driving fast  Underpowered hardware  Loaded with tools

    and stuff  Luckily not the production environment
  14. Crawling Production  More power  But also more load

     How much faster is production than development?  Any estimation on how much better or worse the environments are is incorrect
  15. Stop playing  Real performance tests need real systems 

    Test in production  Clone production infrastructure
  16. Tweets per second  Amount of data is unpredictable 

    Application usage is unpredictable  How thought of using Twitter for build notification?
  17. Dev  Test Test1  Test Test2  Test Test3

     Showing 3/3  Fabian Lange  Uwe Friedrichsen  Mirko Novakovic  Showing 3/6,434,867 Prod
  18. Load Baselines  Syntethic load tests are unrealistic  No

    application has hundreds of users doing the same procedure again and again  Understanding real load is difficult
  19. Live Systems are live  Real usage cannot be generated

     Real usage can be captured & replayed  Be careful 
  20. App Monitor  Continous performance tests  Close to real

    setup  Observe production behavior  Fix issues fast
  21. Let users test?  Can‘t we do anything before production?

     We want to deliver something, which works perfectly!
  22. Sonar  Soft Measure  Works good for code quality

     Are there performance best practices?
  23.  Some people misuse it as loop  Results are

    unexpected behavior or slow execution
  24. Indeed finds bugs  Analyzes Java Bytecode  Knows 58

    Performance Bugs  Most are rather trivial
  25.  Art flickr.com/photos/37202375@N03/3490107873  Magic flickr.com/photos/princes_milady/4238912548  Crossroads flickr.com/photos/40481200@N06/4857965280 

    Envelopes flickr.com/photos/creatingmotherhood/3663914542  Test flickr.com/photos/cayusa/2159980025  Scales flickr.com/photos/reinvented/309512320  Tape Measure flickr.com/photos/hippie/2466583497  World flickr.com/photos/heimdahlrecounts/4346082743  Toys flickr.com/photos/sbluerock/364123380  TPS flickr.com/photos/twitteroffice/5681263084  Bananas flickr.com/photos/design-dog/1249337589  Dart flickr.com/photos/malavoda/2369876508  YSlow developer.yahoo.com/yslow  Pagespeed code.google.com/speed/page-speed  Java Locking en.wikipedia.org/wiki/Double-checked_locking  PHP Ternary Operator fabien.potencier.org/article/48/the-php-ternary- operator-fast-or-not  JavaScript for .. In stackoverflow.com/questions/500504/javascript-for- in-with-arrays  Findbugs findbugs.sourceforge.net  Jlint jlint.sourceforge.net  IBM Multicore SDK www- 01.ibm.com/support/docview.wss?uid=swg21456945