The following functions may affect performance depending on the nature of the script: SendMode, SetKeyDelay, SetMouseDelay, SetWinDelay, SetControlDelay, and SetDefaultMouseSpeed.
Built-in Performance Features
Each script is semi-compiled while it is being loaded and syntax-checked. In addition to detecting some errors early, this also greatly improves runtime performance.
Here are some of the technical details of the optimization process (semi-compiling):
- Loops, blocks, IFs, ELSEs and other control flow statements are given the memory addresses of their related jump-points in the script.
- Each statement name is replaced by an address in a jump table.
- Each expression is tokenized and converted from infix to postfix.
- Each reference to a variable or function is resolved to a memory address, unless it is dynamic.
- Literal integers in expressions are replaced with binary integers.
- The destination of each Goto is resolved to a memory address unless it is a variable.
In addition, during script execution, binary numbers are cached in variables to avoid conversions to/from strings.