Intro to Profiling - raisercostin/software-wiki GitHub Wiki
Profiling is the only way you should make performance optimizations. As you remember "premature optimization is the root of all evil" so don't do this till you don't have a working solution that exhibits performance problems.
See also Intro To Performance
Performance is a catch all term for a lot of things among:
- Time: Fast/Slow
- Memory footprint: Big/Small
- Threads: Many/Few/One
- IO
- network
- storage
Best practices
- Two types of analysis
- instrumentation - you need to filter out methods/packages/libraries that are called a lot of times otherwise this will impact any conclusion
- sampling - you don't see the actual number of calls and each time duration but an aggregated sampled effort:
timePerCall*calls
Tools
- JProfiler has the most intuitive hot spot analysis. Unfortunately is poorly integrated with eclipse and is expensive. It has a 14 days evaluation license else.
- YourKit
Resources
- How to profile https://twitter.com/GeoffreyDeSmet/status/1526464502086131715
- https://stackify.com/java-profilers-3-types/
- http://zvikico.typepad.com/problog/2008/07/jprofiler-your-java-code-could-be-running-faster-in-under-two-hours.html
- https://www.ej-technologies.com/products/jprofiler/ide-eclipse.html
- https://www.ej-technologies.com/download/jprofiler/files
- https://en.wikipedia.org/wiki/Profiling_(computer_programming)
- http://www.baeldung.com/java-profilers