Improving the Performance of Altia Designs
Because Altia products usually handle complex graphical operations with such aplomb, it is not uncommon for users to build interfaces with little regard for efficiency. Sometimes, as the design develops, these inefficiencies can conspire to degrade performance. Here are a few tips that can help keep your Altia designs lean and mean.
- Change your desktop layout to 256 colors when saving Altia designs. This will result in a much smaller .dsn file size and improve load time dramatically. Moreover, many interfaces look just as good with only 256 colors (believe it or not, the libraries included with FacePlate and Design 4.0 were all done with only 256 colors).
- If you are using the Altia API to ferry large amounts of information between an Altia interface and your application code, turn on data buffering using the AtCacheOutput() call. Instead of sending every event immediately and causing the graphics to update for each, Altia will cache the events in memory and send them en masse when the cache is full. This helps prevent extraneous graphics updates and, for most applications, does not change the apparent behavior of the interface.
- An imported image (BMP, XWD or XBM file) assigns colors to individual pixels. As such, it is a heavy entity. Scaling or stretching an image forces Altia to perform involved redraw algorithms whenever those images (or objects on top of those images) are animated. As a result, it is best to stretch or scale an image before importing it into Altia.
- Scaling or stretching text should also be avoided. Scaled or stretched text actually becomes an image and all of the admonitions in the above item apply. Instead of stretching or scaling text, use Altia's Font palette to choose a different size or type of font.
- Rotating an imported image is an expensive operation. Altia has to calculate the new position for every pixel in the raster object for each rotation step.
- Especially when using strip charts, the number of layers of animation should be kept to a minimum. For example, don't place objects on top of or behind the strip chart.
- Animating an object with 400 components is slower than animating an object with 40. If the objects don't contribute significantly to the look and feel of your design, eliminating them will improve performance.
- By using the image object (in imageobj.dsn) instead of importing images directly into your design, you can improve interface load time. The image object references an image file that is external to the design file and can load this image file on demand. Although load time is improved (because of the smaller design file), the time it takes to display the image is increased because it is loaded on the fly.
- A large off-screen pixmap can be slower to draw and will use up more display memory (a problem for X terminals). A small off-screen pixmap will cause more flashing during redraw operations. You can change the *OffScreenPixSize option by using your altia.ini file in the windows directory ($HOME/Altia on UNIX).
Please note that these are merely suggestions for improving the performance of Altia designs. None of the operations or practices described above are forbidden.