|
|
|
|
|
by hiteshk_msft
3581 days ago
|
|
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 |
|
http://gs.statcounter.com/ certainly suggests that specifically optimizing for Chrome/V8 will benefit the majority of users (58% not including mobile, 50% including mobile). As with all statistics, take with a grain of salt.