When I ask Java developers whether they do profile, the answer is usually “no”.
The few that profiled before usually used VisualVM as a student and maybe JProfiler or YourKit years ago at work.
One of the reasons for this is a lack of available information and thus knowledge for everyday Java developers.
This is a pity as profiling should be a part of the tool belt for every experienced developer (not just for Java). The problem is that most of the open-source profilers are targeted to the OpenJDK developers (or their colleagues), even if they won’t admit it. This can be seen in the lack of entry-level material on this topic and even the little that is out there is distributed across multiple conference websites, blogs, YouTube channels, and Twitter accounts.
A few months ago I started working on this topic and as a result, held a talk at the Java User Group Karlsruhe in the middle of October: It is an introductory talk answering the simple questions: Why should we profile? Which profilers to use? How to obtain and view these profiles? A recording can be seen on YouTube:
The gist of this talk is:
Why? Profiling helps you find the parts of your code that are slow and that are worth to be fixed.
Which and how? The consensus seems to be to use JFR or async-profiler with –jfrsync and JMC as a profile viewer.
While working on this talk, I collected a list of interesting conference talks on this topic:
This list includes talks on a variety of profilers, ranging from deep dives to overviews. Many of these talks and people were recommended elsewhere on the internet, on blogs, on Twitter, or in private conversations. Which I present in the following.
I start with a collection of notable blogs which you definitely read if you’re interested to go deeper into profiling:
Aleksey Shipilev: https://shipilev.net/Nitsan Wkart: http://psy-lob-saw.blogspot.com/Richard Startin: https://richardstartin.github.io/Peter Lawrey: http://blog.vanillajava.blog/Martin Thompson: https://mechanical-sympathy.blogspot.com/Jean-Philippe Bempel: https://jpbempel.github.io/Markus Hirt: http://hirt.se/blog/Krzysztof Ślusarski: https://krzysztofslusarski.github.io/
Even the decade-old posts on these blogs are worth reading, as the foundations of profiling did not change in the last few years. Only the tools themselves got more powerful.
In addition to the profiling-focused blogs there are also one-of resources in other locations:
Improving the performance of the Spring-Petclinic sample application (part 1 of 5)Hunting down code hotspots is probably the most common task for Java profilers.Using Java Flight Recorder and Mission Control (Part 1) | foojayJMC/JFR: Kotlin spezial: Profiling/Monitoring with joy (talk slides)
My collection process started before people considered leaving Twitter, so here is a list of people that can be followed on Twitter (and Mastodon) that tweet regularly on the topic of profiling and performance engineering:
Andrei Pangin: Creator of async-profilerJVMPerformance: JVM performance news (old)Alexsey ShipilevJean-Philippe BempelPeter VeentjerGunnar MorlingMario FuscoFrancesco NigroChris Newland: with his homepage full of helper tools to explore JEPs, VM options, … (chriswhocodes.com)
Following these users, you can keep up to date in the field of open-source profiling and discover new talks and discussions regularly.
I know that these resources probably won’t cover the need of everyone. The lack of entry- and mid-level tutorials and talks is still a problem. So I hope that many people from the vibrant profiler community see this outreach not as a burden, but as a virtue: Helping people to discover the joy in profiling and all the neat features that modern profilers have to offer.
If you think I missed a nice resource: Send me a tweet @parttimen3rd or a toot @email@example.com and open a Pull Request to the collection repo on GitHub. I’m also happy to hold a talk on the topic of profiling at your local user group.