Optimizing graphical performance
We discussed graphics and animation in Chapter 8, Graphics and Animations. In this section, we will explore factors that impact performance in graphics and animation. Graphics performance is essential in any application. If your application is poorly implemented, then users may see flickering in the UI or the UI may not update as expected. As a developer, you must make every effort to ensure that the rendering engine maintains a 60 frames-per-second (FPS) refresh rate. There are only 16 milliseconds (ms) between each frame in which processing should be done at 60 FPS, which includes the processing necessary to upload the draw primitives to the graphics hardware.
To avoid any glitch in graphical performance, you should use asynchronous, event-driven programming wherever possible. If your application has huge data processing requirements and complex calculations, then use worker threads to do the processing. You should never manually spin an event...