JProfiler未显示所有调用。

huangapple go评论67阅读模式
英文:

JProfiler does not show all calls

问题

我正在尝试分析 GIF 的编写过程,但自身时间并不累加。所以我不知道发生了什么。

编辑:在问题中添加了格式化的方法

private final ImageWriter gifWriter;

void writeToSequence(RenderedImage img) throws IOException
{
   gifWriter.writeToSequence(
         new IIOImage(
               img,
               null,
               imageMetaData),
         imageWriteParam);
}

编辑2:使用 javax.imageio 进行性能分析

JProfiler未显示所有调用。

JProfiler未显示所有调用。

英文:

I'm trying to profile writing of a gif, but the self time does not add up. So I have no idea what's going on.

JProfiler未显示所有调用。

edit: added method in question with formating

private final ImageWriter gifWriter;

   void writeToSequence(RenderedImage img) throws IOException
   {
      gifWriter.writeToSequence(
            new IIOImage(
                  img,
                  null,
                  imageMetaData),
            imageWriteParam);
   }

edit 2: profiling with javax.imageio

JProfiler未显示所有调用。

JProfiler未显示所有调用。

答案1

得分: 0

>self time does not add up

调用树显示总时间。Self time 是总时间与所有子节点时间总和之间的差值。您可以在视图设置中开启额外的 self time 显示。

在您的情况下,大部分时间直接花在了 GifSequenceWriter.writeToSequence 方法中。

在这种情况下还要考虑一个相关的主题,就是 JProfiler 有一个调用树过滤器的概念。如果一个类未被进行性能分析但仍然显示在树状结构中(因为它被某个经过分析的类直接调用,或者因为它位于树状结构的顶层),那么它的 Self time 可能会很大,因为它调用了其他未经分析的方法。这对于您的 GifSequenceWriter 类并不适用,但对于其下方的 GifImageWriter 类是适用的。您可以通过方法图标左上角的红色标记来识别未经分析的类。

英文:

>self time does not add up

The call tree shows total times. Self time is the difference between the total time and the sum of all child nodes. You can switch on the additional self time display in the view settings.

In your case, most time is spent directly in the GifSequenceWriter.writeToSequence method.

An additional topic that is relevant in this case is that JProfiler has a concept of call tree filters. If a class is unprofiled and is still shown in the tree (because is it called directly by a profiled class or because it is at the top level of the tree), it can have a large self time due to calls to other unprofiled methods. This is not the case for your GifSequenceWriter class, but it is the case for the GifImageWriter class below it. You can recognize unprofiled classes by the red corner in the top left of the method icon.

huangapple
  • 本文由 发表于 2020年9月1日 02:57:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/63676613.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定