Practicing at the Cutting Edge: Learning and Unlearning about Java Performance

750 views

Published on

Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1dImvww.

Martin Thompson overviews Java's evolution, comparing it with C++'s, discussing the challenges of pushing the performance limits. Filmed at qconsf.com.

Martin Thompson is a high-performance and low-latency specialist, with experience gained over two decades working on large scale transactional and big-data systems.

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

No Downloads
Views
Total views
750
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Practicing at the Cutting Edge: Learning and Unlearning about Java Performance

  1. 1. Practicing at the Cutting Edge Learning and Unlearning about Java Performance Martin Thompson - @mjpt777
  2. 2. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /java-evolution-performance InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month
  3. 3. Presented at QCon San Francisco www.qconsf.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  4. 4. Java Performance
  5. 5. Learning and Unlearning
  6. 6. 1. Brief History of Java 2. Evolving Design approach 3. An evolving Hardware platform 4. Changes in Culture
  7. 7. 1. Brief History of Java
  8. 8. Java Timeline 1.0 1.1 96 97 1.2 98 99 1.3 00 1.4 01 02 5 03 04 05 6 06 07 7 08 09 10 11 In the beginning Java was Oak and Oak was slow 12 13
  9. 9. How did it all start?
  10. 10. How did Java perform then?
  11. 11. ...but everything must have a beginning
  12. 12. Java Timeline 1.0 1.1 96 97 1.2 98 99 1.3 00 1.4 01 02 5 03 04 05 6 06 07 7 08 09 10 11 12 Netscape Navigator 2.0 & IE 3.0 with Applet support 13
  13. 13. Ma, I don’t need to worry about deleting objects any more...
  14. 14. ...but we can distribute rich GUIs without an installer
  15. 15. We could even do multi-threaded apps on Windows 3.11
  16. 16. Java Timeline 1.0 1.1 96 97 1.2 98 99 1.3 00 1.4 01 02 5 03 04 05 6 06 07 7 08 09 10 Symantec and Microsoft JIT Performance Wars 11 12 13
  17. 17. Life with early JIT Compilers
  18. 18. Sun vs Microsoft – Round One
  19. 19. ...cross platform GUIs are a real possibility
  20. 20. Java Timeline 1.0 1.1 96 97 1.2 98 99 1.3 00 1.4 01 02 5 03 04 05 6 06 07 7 08 09 10 11 12 Generational Garbage Collection Servlets 13
  21. 21. Jalapeño Processor
  22. 22. But then came the surprise win
  23. 23. Servlets vs CGI
  24. 24. Graph Theory
  25. 25. Java Timeline 1.0 1.1 96 97 1.2 98 99 1.3 00 1.4 01 02 5 03 04 05 6 06 07 7 08 Hotspot Compiler JRockit for x86 09 10 11 12 13
  26. 26. EJB
  27. 27. Sun vs Microsoft – Round Two
  28. 28. Java Timeline 1.0 1.1 96 97 1.2 98 99 1.3 00 1.4 01 02 5 03 04 05 6 06 07 7 08 09 10 11 12 Native Threads on Linux + epoll NIO 13
  29. 29. Java Memory Model
  30. 30. Sun vs Microsoft – Round Two
  31. 31. How did that go?
  32. 32. $1.6 Billion Settlement!
  33. 33. Java Timeline 1.0 1.1 96 97 1.2 98 99 1.3 00 1.4 01 02 5 03 04 05 6 06 07 7 08 09 10 11 Java Util Concurrent + JMM Class Data Sharing 12 13
  34. 34. Herb decided to write an essay...
  35. 35. The free lunch is over...
  36. 36. Java finds its way into our poor little mobile phones
  37. 37. Déjâ vue?
  38. 38. What about life on the Server?
  39. 39. EJB
  40. 40. EJB
  41. 41. Java Timeline 1.0 1.1 96 97 1.2 98 99 1.3 00 1.4 01 02 5 03 04 05 6 06 07 7 08 09 10 11 Escape Analysis Register Allocation Split Bytecode Verification 12 13
  42. 42. How did that go?
  43. 43. What about our hero who freed us from the EJB tar pit?
  44. 44. SQL too difficult?
  45. 45. The world of hardware undergoes big changes!
  46. 46. High Frequency Trading
  47. 47. Milliseconds Matter...
  48. 48. ...Microseconds Matter...
  49. 49. ...right from market open...
  50. 50. ...and especially after a quiet period...
  51. 51. ...it is like being at War
  52. 52. Memory Cliff
  53. 53. Locks and Multi-core
  54. 54. Safepoints!!!
  55. 55. Java Timeline 1.0 1.1 96 97 1.2 98 99 1.3 00 1.4 01 02 5 03 04 05 6 06 07 7 08 09 Tiered Compilation G1 Garbage Collector Compressed Pointers 10 11 12 13
  56. 56. What does the future hold?
  57. 57. What is everyone excited about?
  58. 58. Does our new leader care?
  59. 59. The present day
  60. 60. 2. Evolving Design Approach
  61. 61. GUI Era
  62. 62. Battle for the Desktop
  63. 63. Battle for the Desktop
  64. 64. What was the biggest factor in performance?
  65. 65. People
  66. 66. Reactive Designs Scale Well
  67. 67. Comms are significant to GUIs
  68. 68. Users love responsive interfaces
  69. 69. Modelling
  70. 70. “Big” Data Era
  71. 71. What do the following companies have in common?
  72. 72. Huge product catalogues
  73. 73. Partners Logistics Catalogues Sales PCM Warehousing Manufacturing Websites e-Procurement
  74. 74. Data
  75. 75. Parsing
  76. 76. Stream Processing Rocks!
  77. 77. public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
  78. 78. public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException public void characters(char[] ch, int start, int length) throws SAXException
  79. 79. public String[] split(String regex)
  80. 80. public String[] split(String regex) public Iterable<String> split(String regex)
  81. 81. public String[] split(String regex) public Iterable<String> split(String regex) public void split(String regex, Collection<String> dst)
  82. 82. Set Theory Rocks!
  83. 83. Databases are very powerful!
  84. 84. Immutable Data Rocks!
  85. 85. Batching Rocks!
  86. 86. JDBC Drivers Suck!!!
  87. 87. Modelling
  88. 88. Design Paradigms Different Same Different
  89. 89. Transaction Processing Era
  90. 90. Staged Event Driven Architecture
  91. 91. Synchronous Designs are Limited
  92. 92. The importance of Latency
  93. 93. Latency Latency given Throughput Load
  94. 94. The issues with Concurrency
  95. 95. The Disruptor
  96. 96. The value of Determinism
  97. 97. The value of pure Functions
  98. 98. Modelling
  99. 99. Design Paradigms Different Different Same Different
  100. 100. 3. Evolving Hardware Platform
  101. 101. All Storage is Tape
  102. 102. Networks are faster than Storage
  103. 103. Memory Access Patterns Matter
  104. 104. What if you could build a HashMap with reified generics and arrays of structures?
  105. 105. Buckets
  106. 106. Bob Buckets A1 Key Value Hash Next
  107. 107. Bob Buckets A1 Key Value Hash Next Key Value Hash Next FF Jim
  108. 108. Bob Buckets A1 C7 Fred Key Value Hash Next Key Key Value Hash Next FF Jim Value Hash Next
  109. 109. Buckets Key Value Hash Next
  110. 110. Buckets Value Hash Next A1 0 Key Bob 4 -1
  111. 111. Buckets Hash Next Bob 4 -1 C7 0 Value A1 1 Key Fred 2 -1
  112. 112. Buckets Hash Next Bob 4 2 C7 0 Value A1 1 Key Fred 2 -1 FF Jim 4 -1
  113. 113. .Net Dictionary is 10X faster than HashMap for 2GB of data
  114. 114. Concurrent Garbage Collection?
  115. 115. Safepoints!!!
  116. 116. Shared Nothing to Scale Think Transputers but with messaging passing via SHM
  117. 117. 4. Changes in Culture
  118. 118. Measure Everything
  119. 119. Continuous Profiling
  120. 120. Mechanical Sympathy
  121. 121. Discoveries from Load Testing Most generators are very limited
  122. 122. Discoveries from Load Testing Libs and Frameworks could be much better
  123. 123. What have I learned that is really important?
  124. 124. Research
  125. 125. Experiment
  126. 126. Collaborate
  127. 127. Questions? Blog: http://mechanical-sympathy.blogspot.com/ Twitter: @mjpt777 “It does not matter how intelligent you are, if you guess and that guess cannot be backed up by experimental evidence then it is still a guess.” - Richard Feynman
  128. 128. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations/javaevolution-performance

×