- Reducing the CPU overhead when parsing macros
- Caching the results from calls to the Rift API, especially Inspect.*. This caching needs to at least cache the calls for the duration of each line of a macro and possibly for future calls to macros (for a short sub-second period).
Macro ParsingEach time a macro key is pressed each line of the macro is parsed (one at a time) and checks are performed to determine if an ability should be used, this parsing takes considerable CPU.
The MacroCacheI propose to create a macroCache table that is indexed by a unique name per macro and is populated as each line of a macro is parsed. Each macro will have mandatory nb start <macroname> line so as to determine the start of a macro. The end is determined automatically based on current time-lapsed logic.
A new if statement will be added to the main CMD parser that checks for (in a global macroCache table) and if it doesn't exist stores the value from nb start <macroname> into a global macroTemp variable. Any commands that arrive are then assumed to be for that macro and appended to macroTemp.
When a new nb start is received, any values in tempMacro are copied to macroCache.
Whenever the player leaves combat, macroCache is emptied. macroCache does not build when out of combat to facilitate out of combat testing.