paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 387 forks source link

Re-optimize `ES.TypeIsObject`. #388

Closed cscott closed 8 years ago

cscott commented 8 years ago

Caching the typeof value in a local variable defeats the typeof x === <constant string> peephole optimization, and slows down es6-shim on the doxbee benchmark (on my machine, 20000 iterations) from 5870ms (with this patch) to 6062ms (without it).

ljharb commented 8 years ago

lulz @ js engine optimization