News for hackers. Stuff that matters.
Re:JS MythBusters – An optimization handbook from a high lev... by mintplant on Tuesday August 30, 2016 @04:22PM (#12393530)
> Lookup tables

This one also seems a bit iffy to me, depending on the stage of compilation, how often this code runs, how much information the engine is able to collect, and the size of your table. The initial unoptimized property lookups will likely be slower than if/else statements, and the engine may end up optimizing them with inline caches, which are essentially a chain of if/else comparisons and jumps between dynamically generated code stubs.

> Try-catch

Yep, SpiderMonkey does optimize this case.

There are no comments on this comment yet.