简体   繁体   中英

How to benchmark internal implementation of one java method?

I have been using jmh for few months, and it is a great framework, that gives out the measurement of different java methods.

Now what I would like to know is within that same method, that I have benchmarked with jmh , I would like for x ns/op , to know how much of this x was spent in native calls, and how much was spent in scheduling, etc...

I am not sure if there is a tool to do that.

Maybe following link is some what closer http://docs.oracle.com/javase/7/docs/technotes/samples/hprof.html you can find help info with command java -agentlib:hprof=help . But still it wont give you the time spent in scheduling, switching etc.

What you are likely looking for is a profiler to give you the performance. I know on tool offhand that would be able to accommodate your request, however I am certain there is a number of Java profilers out there that could work for you just as well.

https://code.google.com/a/eclipselabs.org/p/jvmmonitor/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM