Analysis of my prog using the profiler

At the moment my scene is stored in a JInternalFrame and I have a FPSAnimator running.

Here’s an extract of the file created by the profiler during running my programm.

CPU SAMPLES BEGIN (total = 1373) Mon Jun 21 10:39:46 2004
rank self accum count trace method
1 95.99% 95.99% 1318 18 sun.awt.windows.WToolkit.eventLoop

TRACE 18:
sun.awt.windows.WToolkit.eventLoop(WToolkit.java:Native method)
sun.awt.windows.WToolkit.run(WToolkit.java:262)
java.lang.Thread.run(Thread.java:534)

What could be the reason for this. Is this usual? Could it be a mistake which I made using jogl or could it be that the mistake sticks in the application surrounding jogl?

I’m not what you’d call an expert on profiling… but I have to ask, does your program that you are profiling do anything, or is it just a visible frame using FPSAnimator? I’m assuming that you are having a problem with speed or you wouldn’t be profiling things, but I think we’d need more info to attempt to help (since this is probably normal behavior if for example… you don’t draw anything).

In my scene a polarcoordinatesystem with several objects on it is displayed. My animator runs with 10fps. The reason why I did profiling was that if I zoom into the scene by decreasing the clipsize the cpu preformance rises to nearly 100%!

Heres some code:

-for zooming:


/**
* With this method zooming is realised.
* @param factor <0 -> zoom in, >0 -> zoom out
*/
public void zoom(int factor)
{
this.clipSize += clipSize * 0.1 * factor;
System.out.println("ClipSize = " + this.clipSize);
}

-display-method of my GLEventListener :

public void display(GLDrawable drawable)
{
gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, model_view);
gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, projection);
gl.glGetIntegerv(GL.GL_VIEWPORT, viewport);
if (locateCenterFlag)
{
locateCenterPoint();
this.xVector = 0;
this.yVector = 0;
}
else
{
glu.gluUnProject(
this.centerX[0] + this.xVector,
this.centerY[0] + this.yVector,
this.centerZ[0] + this.zVector,
model_view,
projection,
viewport,
worldX,
worldY,
worldZ);
setSceneCenterPoint(worldY[0] * (-1), worldX[0] * (-1), 0.0);
}
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(-clipSize,+clipSize,-clipSize,+clipSize,-clipSize * 100,+clipSize * 100);
glu.gluLookAt(camPos[0],camPos[1],camPos[2],0.0,0.0,0.0,0.0,1.0,0.0);
//Kamera irgendwo auf Z-Achse über (<clipsize) Ursprung
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
this.id = 0;
this.gl.glColor4d(1.0,0.0,0.0,1.0);
showMousePos(this.mouseX,this.mouseY);
this.gl.glFlush();
drawTargets();
this.gl.glFlush();
drawCOSystem();
this.gl.glFlush();
drawZoomCross();
this.gl.glFlush();
if (this.pick)
{
select();
}
this.gl.glFlush();
}