Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Strange Result

Moderators: Vladimir Kondratyev, Anton Katilin

Strange Result

Postby Tobias » Wed Jun 10, 2015 10:34 am

Hello,
I'm profiling a Scala-Application (as Scala runs on the JVM I would guess this should not lead to Problems?) and have strange results.

The measured duration of a specific method is far too high.
As this method is called on different occasions in the Code, it falsifies the results of the callers as well. This sadly leads to unusable results.

I get an duration of about 40% for this one method. When doing "In-Code"-Measurments or using another Profiler i get about 0.1%. Which is an reasonable Result considering the Code-Structure.

I have profiled several runs using sampling with different sampling rates (20ms and lower). Using low rates give an lower duration (but still way too high).
I'm profiling CPU only and have deactivated Exception- and Memory-Profiling.


The Method is (more or less) simply throwing an Exception.
Not sure if the following part maybe leads to problems:
The Exception is not "full-fleged". Its created without cause and Stacktrace.
(If this is relevant and you need more Details on this, let me know)


I hope you can help me to clarify the results :)
Tobias
 
Posts: 2
Joined: Wed Jun 10, 2015 10:22 am

Re: Strange Result

Postby Anton Katilin » Wed Jun 10, 2015 10:54 am

Hello Tobias

The Method is (more or less) simply throwing an Exception.


As far as I understand, you're using CPU sampling. Sampling by its nature can be used to accurately measure only those methods whose call duration exceeds the sampling period. According to your explanation your method is trivial, and sampling is definitely a wrong tool to measure it.

Instead, please measure the method that calls your method. If its duration is comparable with the sampling period you'll get much better results.

Best regards,
Anton
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am

Re: Strange Result

Postby Anton Katilin » Wed Jun 10, 2015 10:56 am

In other words, if you want to perform a micro-benchmarking, the internal in-code measurement approach may be the best for your particular case.
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am

Re: Strange Result

Postby Tobias » Wed Jun 10, 2015 11:05 am

Hello Anton,
thank you very much for your fast answer.

I'm not interrested in micro-benchmarking this method, but in profiling the whole Application.
The Problem is, this specific Method is shown with way to long duration-time in the Overview and I'm wondering what the cause of this problem could be.
Tobias
 
Posts: 2
Joined: Wed Jun 10, 2015 10:22 am

Re: Strange Result

Postby Anton Katilin » Wed Jun 10, 2015 12:13 pm

In this case, please ignore results for this short leaf methods, and see instead results for its caller (or caller of its caller etc.) with an individual call duration exceeding the sampling period.
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am

Re: Strange Result

Postby Anton Katilin » Wed Jun 10, 2015 12:14 pm

P.S. Please also consider CPU tracing.
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am


Return to Java Profiler

Who is online

Users browsing this forum: Bing [Bot] and 8 guests