mariamhakobyan / java-performance-notes

Java Performance Notes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java-performance-notes

Chapter 1: Introduction

  • A good algorithm is the most important thing when it comes to fast performance.
  • Write less code
  • Every line of code involves a choice, and if there is a choice between two simple, straightforward ways of programming, choose the more performant one.
  • Bugs and Performance Issues Aren’t Limited to the JVM
  • Ockham's razor is a principle from philosophy.
    • Suppose there exist two explanations for an occurrence. In this case the simpler one is usually better.
    • Another way of saying it is that the more assumptions you have to make, the more unlikely an explanation is.

Chapter 2: An Approach to Performance Testing

Four Principles of Performance Testing

  • Test a Real Application
    • The first principle is that testing should occur on the actual product in the way the product will be used.

Three types of Performance Testing

  • Microbenchmarks
    • A microbenchmark is a test designed to measure a very small unit of performance.
      • e.g. the time to call a synchronized method versus a nonsynchronized method
    • Microbenchmarks may seem like a good idea, but they are very difficult to write cor‐ rectly.
  • Macrobenchmarks
  • Mesobenchmarks

About

Java Performance Notes