Two additional areas may be optimized for efficiency:
data structure
* lists in StrokesPlus.xml sorted by their frequency in descending order
** with most frequent on top (aka <Action> right after <Actions>, <Application> right after <Applications>), it can be done with simple text editor, XML manager that supports drag and drop, or XML parser with methods.
algorithm
* cache compiled code
** Similar to StrokesPlus.NET's underlying Chrome V8 engine, StrokesPlus script code can be cached with Lua's built-in function string.dump that generates compiled code as binary chunk. The following snippet is an example:
tGactExecuted = {} -- if this line doesn't go in Global Lua, wrap it inside if control structure
if not tGactExecuted[gact] then
io.open(gact, 'wb'):write(string.dump(assert(load/loadfile(script string/file) goes here))):close()
tGactExecuted[gact] = true
end
loadfile(gact, 'b')(gsx, gsy, gex, gey, gbl, gbt, gbr, gbb)