Well there is lot of things to avoid, eg.: to avoid hasField or doesExists for node props or AAs and replace it with simple type(node["myProp"]) <> "Invalid" to decrease performance leak, when I do it in loop for nth thousands of repeating it could be different in a few seconds! (depends on your roku device, I have Roku 3 which is kinda good but some older Roku Stick where is really different for 1ms per one operation, so loop with 1200 repeating is reduced for 1200 ms), and so.
Basically is good to work often with measuring util as roTimespan to figure out this issues.
NOTE: subtype() is also expensive method without workaround but just store it to variable when you need to use it repeatable.