Avoid deopt in iterable destructure template #1821

Merged
merged 2 commits into from Jun 25, 2015

Projects

None yet

2 participants

@kpdecker
Contributor

The try/catch was forcing deoptimization under most engines. This roughly doubles throughput under V8 and 7x increases were seen under Firefox.

Performance numbers based on https://github.com/kpdecker/six-speed/tree/master/tests/destructuring

@kpdecker kpdecker Avoid deopt in iterable destructure template
The try/catch was forcing deoptimization under most engines. This roughly doubles throughput under V8 and 7x increases were seen under Firefox.

Performance numbers based on https://github.com/kpdecker/six-speed/tree/master/tests/destructuring
1b0e5b3
@kittens
Member
kittens commented Jun 25, 2015

It'd be worth moving that function out so it's not recreated each time. ie. something like what's done already like in src/babel/transformation/templates/helper-create-class.js.

@kpdecker kpdecker Move slice iterator helper out of primary call
Avoids overhead of instantiating the helper on each call to the slice to array helper.
5353ccd
@kpdecker
Contributor

Done.

@kittens kittens merged commit 560a044 into babel:master Jun 25, 2015

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@kittens
Member
kittens commented Jun 25, 2015

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment