A suggestion for those building web applications using the JmolApplet ...

Unless you have a good reason to do otherwise, I suggest that you make
your applet windows square. That is, width == height.

Why? For performance reasons.

There are a couple of factors involved

1. Jmol has to clear the entire screen to the background color each time a
frame is painted. The bigger the applet window, the longer it takes to
clear.

2. Jmol automatically calculates the scaling based upon the smaller of the
width or the height. (So that a spacefill version of the molecule will fit
within the minimum dimension.)

3. Unless a 'zoom' operation is used, the 'excess' pixels will never be used.

Let's take an example. Assume we make our applet window a rectange 300
high by 600 wide. Jmol will 'fit-to-screen' so that the molecule will fit
within 300 pixels. So, along 'width' dimension there will be 300 pixels
that will never be used ... 150 on the left and 150 on the right. Yet
these pixels will need to be cleared every time ... 90k extra pixels that
we are clearing every time, but are never using.

90K pixels may not sound like much ... but there are 4 bytes per pixel for
rgb information + 2 bytes per pixel for zbuffer use = 6 bytes per pixel =
540Kb. And we are repeatedly clearing this at mouse-rotation speed ...
hopefully 20+ frames/second.

Plus, we have to send these extra pixels to the screen as well. And the
Java graphics routines are not the fastest in the world.

You can have exactly the same thing in a 300x300 window and avoid all this
extra cpu, memory, and screen overhead.

Now, remember that this does not apply if you are using zoom operations.
Because then you may have a reason to explictly show something in a
rectangle instead of a square.

But if you are not doing that ... make it square.


Miguel







-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
Jmol-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to