Some of these suggestions are good but some caveats:
- Lookup tables- while lookup tables are great, engines might sometimes convert switch statements to lookup tables too- Chakra does this when it's advantageous to do so
- Try-catch- this seems like v8 specific advice. Chakra definitely does optimize functions with try-catch in it, and I think SpiderMonkey does too
- Freeing memory- setting the reference to null does not necessarily free the memory- it just makes it likelier to get collected when the Garbage Collector runs
Disclaimer: MSFT employee, Engineer on Chakra