codemix/fast.js — pull request #32 by phpnode (2014-06-28 02:28:32+00:00)
Title: Implement fast.try()

In both V8 and SpiderMonkey, try..catch blocks cause functions to be deoptimised. This is a function which isolates try catch blocks into a separate function, allowing the rest of the function to be optimised properly. This has quite striking results:

#### V8

```
fast.try() vs try {} catch (e) {}
✓ try...catch x 109,148 ops/sec ±1.34% (81 runs sampled)
✓ fast.try() x 3,531,501 ops/sec ±1.20% (83 runs sampled)

Winner is: fast.try() (3135.50% faster)
```

#### SpiderMonkey

```
fast.try() vs try {} catch (e) {}
✓ try...catch x 88,915 ops/sec ±0.99% (64 runs sampled)
✓ fast.try() x 4,969,804 ops/sec ±0.16% (70 runs sampled)

Winner is: fast.try() (5489.40% faster)
```