paulmillr / es6-shim

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

Improve performance of Promises #383

Closed cscott closed 8 years ago

cscott commented 8 years ago

These patches improve the performance of Promises by roughly a factor of 2x, resulting in performance on the doxbee sequential benchmark equivalent to the core-js Promise implementation and within a factor of two of v8's native Promise implementation. It also results in about 50% less memory usage on that benchmark than either core-js or v8 native Promises.

The improvements to TypeIsObject and IsCallable also improve the performance of other parts of the shims.

ljharb commented 8 years ago

Thanks, this looks great! I have a number of minor comments but after those and a fresh rebase, this should be good to go.

cscott commented 8 years ago

Ok, rebased with fixes from your comments applied.

ljharb commented 8 years ago

@cscott crap, sorry, I cherry picked two of your commits and pushed them up not realizing you'd already done the rebase. Would you mind one more rebase? :-) if not i'll merge manually

cscott commented 8 years ago

rebased, no problem.