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.
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
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.