• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Well-Grounded Java Developer: JMH

 
Ranch Hand
Posts: 378
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.
 
Bartender
Posts: 15737
368
  • 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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic