This presentation covers effectiveness of Java applications. There are a lot of code samples that were measured using JMH library. For some samples we performed optimization to improve performance
2. About author
• Works in IT since 2000
• 12 year of Java SE/EE experience
• Regular speaker at Java conferences
• Author of “Development of Java applications” and
“Main errors in Java programming ”books
• Founder of http://it-simulator.com
6. Effectiveness
• Hard to determine on code/design review stages or
in unit-tests
• Is relevant for the specific project configuration
• Cannot be defined in development environment
• Depends on the application environment
• Premature optimization is evil
• Hardware-specific
10. Measurements
• JMH is micro benchmarking framework
• Developed by Oracle engineers
• First release in 2013
• Requires build tool(Maven, Gradle)
• Can measure throughput or average time
• Includes warm-up period
38. Measurements
Type Time(ns)
Fill array (1000 elements) 148
Fill bit set(1000 elements) 1520
Fill array (50 000 elements) 4669
Fill bit set(50 000 elements) 71395
40. Measurements
Type Time(ns)
Fill array (1000 elements) 148
Fill bit set(1000 elements) 261
Fill array (50 000 elements) 4669
Fill bit set(50 000 elements) 12758