All actions are executed within the context of an event delivery and as such their execution will have an impact on the overall throughput and responsiveness of the system. In particular with Lua scripts, it is important to limit the length of time that functions take to perform their work or to separate lengthy operations into separate tasks, threads or processes depending on the operating environment being used. The performance logs will provide a detailed account of how long various actions take to execute, but within your Lua scripts a profiling tool such as Lua Profile can provide additional insight into your script execution.
The screen manager listens for data changes and checks the state of controls to determine when the display needs to be refreshed. In general practice the screen manager throttles data updates in a way that batches changes together to prevent visual flicker and excessive update of the display (in particular in situations where the display is not double buffered). However, there may be sequences of events or data changes that do not occur atomically and may result in excessive work to be performed and consume un-necessary CPU cycles. In these situations when multiple events are going to be changing data values, moving controls, or generating more events which would cause the display to be updated, and they are known to occur in a particular sequence, it is advisable to hold the screen manager updates until all changes have been made. Once modifications are complete the screen manager can be released and the display updated is needed. The actions are as follows:
gra.screen.hold
gra.screen.release