Java Performance
                             What’s the big deal?
                               Trisha Gee, Developer
                                    @trisha_gee
                              mechanitis.blogspot.com



Wednesday, 17 October 12
Who are you and what
                     do you want?


Wednesday, 17 October 12
So, performance....

                   • Where do I start?
                   • Things to consider...
                   • Frequently asked questions
                   • What Not To Do
                   • Questions?

Wednesday, 17 October 12
Where do I start?



Wednesday, 17 October 12
Do you
                            really
                            care?


Wednesday, 17 October 12
Do you care about...?




                   •       Latency




Wednesday, 17 October 12
Do you care about...?




                   •       Throughput




Wednesday, 17 October 12
Do you care about...?




                   •       Responsiveness




Wednesday, 17 October 12
Do you care about...?




                   •       Stability




Wednesday, 17 October 12
Do you care about...?




                   •       Restricted hardware




Wednesday, 17 October 12
NFRs Are Not Evil

                   •       99.99% of all orders processed in less than 10ms

                   •       7000 tweets per second

                   •       Pages load in less than 0.1 seconds

                   •       Must be able to fail over in less than 10 seconds

                   •       2000 price updates per second with 99% latency of <10ms




Wednesday, 17 October 12
Latency




Wednesday, 17 October 12
Latency




Wednesday, 17 October 12
Considerations



Wednesday, 17 October 12
Cost / Benefit




Wednesday, 17 October 12
The Real World




Wednesday, 17 October 12
Mechanical Sympathy




Wednesday, 17 October 12
Testing


                   • “Performance” testing
                   • Load testing
                   • Red Line / Capacity
                   • Stress testing

Wednesday, 17 October 12
Where are your bottlenecks?




Wednesday, 17 October 12
Planning for the Future




Wednesday, 17 October 12
Planning for the Future




Wednesday, 17 October 12
Planning for the Future




Wednesday, 17 October 12
Planning for the Future




Wednesday, 17 October 12
Planning for the Future




Wednesday, 17 October 12
Compromises




Wednesday, 17 October 12
FAQs



Wednesday, 17 October 12
Questions




Wednesday, 17 October 12
Questions
               • Why Java?




Wednesday, 17 October 12
Questions
               • Why Java?
               • How does technology x compare to
                      technology y?




Wednesday, 17 October 12
Questions
               • Why Java?
               • How does technology x compare to
                      technology y?
               • How can I run multi-threaded / in parallel?



Wednesday, 17 October 12
Questions
               • Why Java?
               • How does technology x compare to
                      technology y?
               • How can I run multi-threaded / in parallel?
               • Can I throw more hardware at it?


Wednesday, 17 October 12
Questions
               • Why Java?
               • How does technology x compare to
                      technology y?
               • How can I run multi-threaded / in parallel?
               • Can I throw more hardware at it?
               • How do I speed up <item out of my control>?

Wednesday, 17 October 12
Questions
               • Why Java?
               • How does technology x compare to
                      technology y?
               • How can I run multi-threaded / in parallel?
               • Can I throw more hardware at it?
               • How do I speed up <item out of my control>?
               • Where’s my magic bullet?
Wednesday, 17 October 12
Common Pitfalls



Wednesday, 17 October 12
Tune By Gut




Wednesday, 17 October 12
Myth Based Development




Wednesday, 17 October 12
It Works On My Machine




Wednesday, 17 October 12
Misleading Microbenchmarks




Wednesday, 17 October 12
Profiler Is God




Wednesday, 17 October 12
More Hardware Required




Wednesday, 17 October 12
Too Smart For New Hardware




Wednesday, 17 October 12
Disregarding the Laws of
                                   Physics




Wednesday, 17 October 12
The Never Ending Story




Wednesday, 17 October 12
OK fine...



Wednesday, 17 October 12
Java Stuff

                   • The Garbage Collector Is Not Your Enemy
                   • The JVM Is Smarter Than You
                   • Synchronized Is Evil
                   • Don’t Forget The Machine
                   • ...it might not be your code

Wednesday, 17 October 12
In Summary



Wednesday, 17 October 12
In Summary



                   • What is is you really care about?
                   • The real world matters
                   • There is no magic bullet


Wednesday, 17 October 12
Science, Not Art




Wednesday, 17 October 12
Questions?



Wednesday, 17 October 12
Resources

                   • We Don’t Need No Stinkin’ Locks! -
                           3:45pm (now)
                   • Are your GC Logs Speaking to You? 3:45pm
                           (now - typical)
                   • Martin’s Performance Myths presentation
                   • Kirk’s Performance Tuning course
                   • Coding the Architecture
                   • http://is.gd/javaperf
Wednesday, 17 October 12

Java performance: What's the big deal? - Trisha Gee