Miguel wrote:
Miguel, why in the older versions of Jmol does the wireframe change
when one executes "spin on"?
nevermind. I new that couldn't be possible .... it was from a hidden
script in one of my test files!
I've done some careful testing. more than 60 iterations comparing
10.00.47 and 10.x (prototype).
<script language=javascript>
jmolInitialize(".")
jmolApplet(600,"load 1crn.pdb;wireframe 0;spacefill 0; spin on")
</script>
(blank screen, of course!)
10.00.48: Speedy devil, essentially no CPU usage.
10.x : 60-70% CPU usage
Guess what?
The CPU usage is not in rendering, it's not in mouse or transformation
manager routines that Bob messed up. It isn't statusManager doing nasty
things. Check out the following data from Viewer.render1:
TEST #1: (current prototype)
void render1(Graphics g, Matrix3f matrixRotate, boolean antialias, int x,
int y) {
g3d.beginRendering(rectClip.x, rectClip.y, rectClip.width,
rectClip.height,
matrixRotate, antialias);
repaintManager.render(g3d, rectClip, modelManager.getFrame(),
repaintManager.displayModelIndex);
g3d.endRendering();
Image img = g3d.getScreenImage();
try {
g.drawImage(img, x, y, null);
} catch (NullPointerException npe) {
System.out.println("Sun!! ... fix graphics your bugs!");
}
g3d.releaseScreenImage();
}
RESULT: 63% CPU
ANALYSIS: This is similar to what Nico is observing.
TEST #2: Let's get rid of all the graphics production
void render1(Graphics g, Matrix3f matrixRotate, boolean antialias, int x,
int y) {
/*
g3d.beginRendering(rectClip.x, rectClip.y, rectClip.width,
rectClip.height,
matrixRotate, antialias);
repaintManager.render(g3d, rectClip, modelManager.getFrame(),
repaintManager.displayModelIndex);
g3d.endRendering();
*/
Image img = g3d.getScreenImage();
try {
g.drawImage(img, x, y, null);
System.out.println(x+" "+y);
} catch (NullPointerException npe) {
System.out.println("Sun!! ... fix graphics your bugs!");
}
g3d.releaseScreenImage();
}
RESULT: 0-2%CPU usage
ANALYSIS: no surprise here; we aren't doing anything.
TEST 3: OK, how about no rendering?
void render1(Graphics g, Matrix3f matrixRotate, boolean antialias, int x,
int y) {
g3d.beginRendering(rectClip.x, rectClip.y, rectClip.width,
rectClip.height,
matrixRotate, antialias);
// repaintManager.render(g3d, rectClip, modelManager.getFrame(),
// repaintManager.displayModelIndex);
g3d.endRendering();
Image img = g3d.getScreenImage();
try {
g.drawImage(img, x, y, null);
} catch (NullPointerException npe) {
System.out.println("Sun!! ... fix graphics your bugs!");
}
g3d.releaseScreenImage();
}
RESULT: 60-63% CPU
ANALYSIS:
Well, this was a surprise. Notice that there is no rendering being done
at all. (That is, for the RECORD, none of my streamlined
Viewer/TransformationManager methods are being accessed whatsoever.) The
only significant Jmol code being excecuted differently between these two
tests involve the following five methods:
g3d.beginRendering();
g3d.endRendering();
g3d.getScreenImage();
g.drawImage(img, x, y, null);
g3d.releaseScreenImage();
So please don't imply that it was something I did with the
transformation manager and spin that brought this condition on. I think
it IS the Z-buffer being integers. For whatever reason, allocation of
those buffers is just hugely costly.
TEST #5. Effect of window size:
dependence on image size: full spin, with rendered wireframe and balls,
1crn.pdb. spin Y 30.
image size CPU
900x900 70-74%
800x800 66-71%
700x700 61-66%
600x600 60-62%
500x500 60-63%
400x400 35-45%
300x300 22-29%
200x200 10-14%
Tell me this not the Z-buffer.
Here's what I think: Going to ints quadrupled the byte-size of the image
allocation. Turns out that has a roughly quadruple effect on (some)
CPUs. I'm betting that some "power" graphics PCs don't blink at this,
but other more standard ones can just die in their tracks.
How do I apply the z-buffer patch so I can try it myself with a short
z-buffer?
Bob
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers