Java Performance: What developers must know

6,276 views
6,448 views

Published on

In my career, I could help some companies to solve many application performance issues. After several suggestions from colleagues, I have tried to put together in this presentation the main points that I think Java developer should take into account to fix and prevent performance issues.

Published in: Technology, News & Politics
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,276
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
78
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Java Performance: What developers must know

  1. 1. Java Performance What Developers Must Know Diego Lemos
  2. 2. We care about performance... (credit: http://www.morguefile.com/) ...when things go bad.
  3. 3. Panic Driven Actions ● Add more hardware ● Work on ugly code ● Long Meetings (?!) ● Blame somebody
  4. 4. Milliseconds Matter ● Amazon: – ● Increase 100ms in load time decreased sales by 1% Google: – From loading a 10-result page in 0.4 seconds to a 30result page loading in 0.9 seconds decreased traffic and ad revenues by 20%
  5. 5. Measure Don’t Guess ● Support decisions by measurements ● Tune what matters (credit: http://xkcd.com)
  6. 6. Generic Application Stack Application Profiling JVM Heap Analysis Operating System Monitor System Hardware
  7. 7. Tools ● vmstat, iostat, netstat ● JMeter, Gatling ● HPjmeter ● VisualVM, jconsole
  8. 8. Demo :
  9. 9. Any problem here? Java heap space
  10. 10. And here? Everything is OK!
  11. 11. What happened here? "catalina-exec-8190-104" - Thread t@135 java.lang.Thread.State: BLOCKED at com.google.code.morphia.Morphia.mapPackage(Morphia.java:72)
  12. 12. Performance Best Practices ● ● ● ● Test one build a day for performance issues (continuous integration) Monitoring (production env.) for compliance Keep users at the center of performance tuning efforts Devs + Ops
  13. 13. Performance Tests on CI
  14. 14. Follow Coding Best Practices ● KISS – ● complex code is hard to optimize Loose coupling – – ● Optimize without fear of breaking anything else Avoid contamination (external applications) Let your objects die young
  15. 15. Performance myths ● Tune by default (early tuning) ● Optimize by precaution (over-engineer) ● The architecture cannot change ● Hardware will solve the problem
  16. 16. Conclusion ● Think performance before problems come ● Devs + ops working together ● Monitor your application
  17. 17. More on this ● http://java.dzone.com/kirk-dominating-consumer ● https://github.com/dlresende/spring-petclinic ● http://jmeter.apache.org/usermanual/glossary.html ● http://www.oracle.com/technetwork/java/javase/gc-tunin ● http://munchweb.com/effect-of-website-speed ● http://www.javaworld.com/article/2073905/build-ci-sdlc

×