javaprofilingnettyexecution-timejava-nio

Java - netty library execution time very big - Java NIO


I am developing a Java application that reads data from a Redis Database, I use Lettuce library to connect to Redis which in turn uses 'Netty' library to communicate with Redis I suspect that the execution time of my application is greater than expected, so a conducted a profiling experiment using JProfiler, I was surprised that a FastThreadLocalRunnable takes a significant portion of the execution time with no justification as the tree shows no function calls taking time:

Screenshot from JProfiler after some long time of execution

So, is it a bug in Lettuce library?, or is it a problem in the profiler measuring the execution time?

Any help is appreciated


Edit:

Thanks to Ingo's answer I can now expand the tree but it turns out that the java NIO is consuming my processor:

Java NIO is taking the processing power

Any idea?


Solution

  • The call tree in JProfiler only shows classes that are included in the call tree filters that you define in the profiling settings:

    enter image description here

    By default, this excludes a lot of common frameworks and libraries so that you can get started without configuring anything. It is better if you delete these filters and add your own profiled packages here.

    In addition to the profiled classes, JProfiler shows the thread entry point even it is not a profiled class, such as io.netty.util.concurrent.FastThreadLocalRunnable. Also, the first call into non-profiled classes is always shown at any level in the call tree.

    In your case there are call chains to non-profiled classes below io.netty.util.concurrent.FastThreadLocalRunnable that never call a profiled class. They could belong to some framework or to some part of your code that is not included in the profiled classes. This time has to go somewhere, so it is attributed to the io.netty.util.concurrent.FastThreadLocalRunnable node.

    An easy way to check is to disable filtering in the profiling settings, then you see all classes.

    enter image description here

    More information about call tree filters can be found at

    https://www.ej-technologies.com/resources/jprofiler/help/doc/main/methodCallRecording.html