I have a program that repeatedly invokes "sun.java2d.loops.GraphicsPrimitiveMgr$2.compare(object, object)" - millions of times. The program uses custom painted components and at times uses BufferedImages of TYPE_4BYTE_ABGR, and uses transparent colors. The methods that paint the components are not invoked many times, yet this "sun.java2d.loops.GraphicsPrimitiveMgr$2.compare(object, object)" method is constantly invoked.
Please help with ideas.
Whatever performance hit you're seeing is not because of the GraphicsPrimitiveMgr.compare() calls
but because of the unusual image type you're using. We don't have many loops for this type,
so we have to convert it to an intermediate image of type INT_ARGB first and then one more time INT_ARGB to the destination type.
Do you really need this image type? INT_ARGB will be much faster. Also, if you don't need translucency,
INT_RGB will be even better.
Thanks,
Dmitri