Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Well-Grounded Java Developer: JMH

 
Ranch Hand
Posts: 377
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Is there a chapter that discusses JMH?

It may be useful in this context, but I didn't find anything in the TOC.

Regards,

Germán
Staff note (Junilu Lacar) :

You can find more information about the Java Microbench Harness (JMH) here: https://github.com/openjdk/jmh

 
author
Posts: 67
10
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The performance chapter doesn't cover JMH.

There is some material about it in my book "Optimizing Java" (O'Reilly) - but I do advise caution.

In practice, very few Java developers really need to use JMH. It is *not* a general-purpose benchmarking tool but instead is useful in a couple of special cases.

When doing general application performance analysis, you need to start with a "top-down" approach, rather than a "bottom-up" one.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adding to this.  It's very much a tool that is used by VM Engineers (folks who work on the JVM/HotSpot itself) or who write really small functions/libraries that need optimizing (low latency trading systems comes to mind).  Often high level application developers will be misled by this tool when a micro-optimization may not realise into a gain in their app.
 
Saloon Keeper
Posts: 15657
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even though for general application development, the use of micro-benchmarking frameworks is limited when compared to profiling tools, I will say that JMH is very useful for verifying any assumption you might make about basic data structures that are provided by the standard library.

For example, I find it very satisfying to see for myself how an ArrayDeque compares to a LinkedList performance-wise, when used as a simple stack.
 
I am displeased. You are no longer allowed to read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic