O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Optimizing Java, 1st Edition

Book Description

Currently, no books exist that focus on the practicalities of Java application performance tuning, as opposed to the theory and internals of Java virtual machines. This practical guide is the "missing link" that aims to move Java performance tuning from the realm of guesswork and folklore to an experimental science.

  • Learn how to approach performance problems in an consistent and systematic way
  • Resolve production performance issues by learning core Java performance topics
  • Identify and resolve performance issues before encountering them in production
  • Understand the performance problems you encounter by learning the Java platform’s internals

Table of Contents

  1. 1. Optimization and Performance Defined
    1. Java Performance - The Wrong Way
    2. Java Performance Overview
    3. Performance as an Experimental Science
    4. A Taxonomy for Performance
      1. Throughput
      2. Latency
      3. Capacity
      4. Utilisation
      5. Efficiency
      6. Scalability
      7. Degradation
      8. Connections between the observables
    5. Reading performance graphs
  2. 2. Overview of the JVM
    1. Overview
    2. Interpreting and Classloading
    3. Executing bytecode
    4. Introducing HotSpot
      1. Introducing Just-In-Time Compilation
    5. JVM Memory Management
    6. Threading and the Java Memory Model
    7. The JVM and the operating system
  3. 3. Hardware & Operating Systems
    1. Introduction to Modern Hardware
    2. Memory
      1. Memory Caches
    3. Modern Processor Features
      1. Translation Lookaside Buffer
      2. Branch Prediction and Speculative Execution
      3. Hardware Memory Models
    4. Operating systems
      1. The Scheduler
      2. A Question of Time
      3. Context Switches
    5. A simple system model
    6. Basic Detection Strategies
    7. Context switching
    8. Garbage Collection
    9. I/O
      1. Kernel Bypass I/O
      2. Mechanical Sympathy
    10. Virtualisation
  4. 4. Performance Testing Patterns and Antipatterns
    1. Types of Performance Test
      1. Latency Test
      2. Throughput Test
      3. Load Test
      4. Stress Test
      5. Endurance Test
      6. Capacity Planning Test
      7. Degradation Test
    2. Best Practices Primer
      1. Top-Down Performance
      2. Creating a test environment
      3. Identifying performance requirements
      4. Java-specific issues
      5. Performance testing as part of the SDLC
    3. Introducing Performance Antipatterns
      1. Boredom
      2. Résumé Padding
      3. Peer Pressure
      4. Lack of Understanding
      5. Misunderstood / Non-Existent Problem
    4. Performance Antipatterns Catalogue
      1. Distracted By Shiny
      2. Description
      3. Example Comment
      4. Reality
      5. Discussion
      6. Resolutions
      7. Distracted By Simple
      8. Description
      9. Example Comments
      10. Reality
      11. Discussion
      12. Resolutions
      13. Performance Tuning Wizard
      14. Description
      15. Example Comment
      16. Reality
      17. Discussion
      18. Resolutions
      19. Tuning By Folklore
      20. Description
      21. Example Comment
      22. Reality
      23. Discussion
      24. Resolutions
      25. Blame Donkey
      26. Description
      27. Example Comment
      28. Reality
      29. Discussion
      30. Resolutions
      31. Missing the Bigger Picture
      32. Description
      33. Example Comments
      34. Reality
      35. Discussion
      36. Resolutions
      37. UAT Is My Desktop
      38. Description
      39. Example Comment
      40. Reality
      41. Discussion
      42. Resolutions
      43. Production-like Data Is Hard
      44. Description
      45. Example Comment
      46. Reality
      47. Discussion
      48. Resolutions
    5. Cognitive Biases and Performance Testing
      1. Reductionist Thinking
      2. Confirmation Bias
      3. Fog of war (Action Bias)
      4. Risk bias
      5. Ellsberg’s Paradox
  5. 5. Microbenchmarking and statistics
    1. Introduction to measuring Java performance
    2. Introduction to JMH
      1. Don’t microbenchmark if you can help it - a true story
      2. Heuristics for when to microbenchmark
      3. The JMH Framework
      4. Executing Benchmarks
    3. Statistics for JVM performance
      1. Types of Error
      2. Non-normal statistics
      3. Interpretation of statistics
    4. Summary
  6. 6. Understanding Garbage Collection
    1. Introducing Mark & Sweep
      1. Garbage Collection Glossary
    2. Introducing the Hotspot runtime
      1. Representing objects at runtime
      2. GC Roots and Arenas
    3. Allocation and lifetime
      1. Weak Generational Hypothesis
    4. Garbage Collection in Hotspot
      1. Thread-local allocation
      2. Hemispheric Collection
    5. The parallel collectors
      1. Young parallel collections
      2. Old parallel collections
      3. Limitations of parallel collectors
    6. The role of allocation
    7. Summary