我正在开发一个Java应用程序,该应用程序从 redis
数据库中读取数据,我使用生菜
库将其连接到 redis
,又使用'netty'库与 redis
进行通信
我怀疑我的申请的执行时间比预期的要大,因此使用 jprofiler
进行了分析实验,令我惊讶的是, FastThreadLocalRunnable
采取了很大一部分的执行。没有理由的时间,因为树显示没有函数调用时间花费时间:
在测量执行时间的剖面师中?
都值得赞赏
对任何帮助的编辑
:多亏了Ingo的答案,我现在可以展开树,但事实证明,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:

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:

Any idea?
发布评论
评论(1)
Jprofiler中的呼叫树仅显示您在分析设置中定义的呼叫树过滤器中包含的类:
默认情况下,这排除了许多常见的框架和库,以便您可以开始没有配置任何东西。如果您删除这些过滤器并在此处添加您自己的个人化软件包,那就更好了。
除了介绍的类外,Jprofiler还显示了线程入口点,即使它不是介绍的类,例如
io.netty.util.concurrent.concurrent.fastThreadLocalRunnable
。同样,在呼叫树中的任何级别上始终显示第一个呼叫,始终显示。就您而言,在
io.netty.util.concurrent.fastthreadlocalrunnable
下面有非专业类的呼叫链,从不调用个人资料类。它们可能属于某个框架或代码的某些部分,而这些框架中未包含在介绍的类中。这次必须去某个地方,因此它归因于io.netty.util.concurrent.fastthreadlocalrunnable
node。一种简单的检查方法是在分析设置中禁用过滤,然后您看到所有类。
有关呼叫树过滤器的更多信息,请访问
https://www.ej-technologies.com/resources/jprofiler/help/help/doc/main/methodcallrecording.html
The call tree in JProfiler only shows classes that are included in the call tree filters that you define in the profiling settings:
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 theio.netty.util.concurrent.FastThreadLocalRunnable
node.An easy way to check is to disable filtering in the profiling settings, then you see all classes.
More information about call tree filters can be found at
https://www.ej-technologies.com/resources/jprofiler/help/doc/main/methodCallRecording.html