GraphicsPrimitiveMgr

Under what situations does GraphicsPrimitiveMgr get called? We are calling it a lot and would like to avoid it. This is the profile with 712 blits to the screen.


   1 11.56% 11.56%  403073    39 sun.java2d.loops.GraphicsPrimitiveMgr$2.compare
   2  9.22% 20.78%  399175   239 java.lang.String.compareTo
   3  8.69% 29.47%  359899   364 sun.java2d.loops.GraphicsPrimitiveMgr.compareSurfaces
   4  6.48% 35.96%  359899   325 sun.java2d.loops.GraphicsPrimitiveMgr.access$000

This is a totally implementation dependant question isn’t it?

If I were you and i wanted to knwo this for my particular case (my code and the exact version of the JDK/VM I was using) I’d fire up a profiler and look at the call traces.

Jk

The call traces related to the GraphicsPrimitiveMgr unfortunately aren’t at all clear (to me anyway). They don’t correspond to any methods that we are calling:


TRACE 39:
sun.java2d.loops.GraphicsPrimitiveMgr$2.compare(GraphicsPrimitiveMgr.java:Unknown line)
java.util.Arrays.binarySearch(Arrays.java:Unknown line)
sun.java2d.loops.GraphicsPrimitiveMgr.locate(GraphicsPrimitiveMgr.java:Unknown line)
sun.java2d.loops.GraphicsPrimitiveMgr.locatePrim(GraphicsPrimitiveMgr.java:Unknown line)

This call trace corresponds to the first line in from the original post.

jd

That can’t possibly be the full trace.

How are you getting the trace? Are you using a real tool like OptimizeIt or trying to guess from the limited info you get from Hprof?

I recognize the reference to sun.java2d.loops. This is deep in the Java2D render pipeline.