google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.18k stars 580 forks source link

Implement bulk re-exports for instantiate setter perf #1957

Closed guybedford closed 9 years ago

guybedford commented 9 years ago

Aurelia had some issues with bulk exports causing performance bottlenecks due to the repeated bindings being called in quadratic multiples of the depth of export * usage. This function flattens the binding call in one go. It may be worth always having $__export({ name: 'value' }) as an object so we don't need to overload the function, so could look at a PR to do this if you think it is worthwhile, but the named form of $__export(name, 'value') will still be necessary for backwards compatibility for a while regardless.

Associated ModuleLoader PR is at https://github.com/ModuleLoader/es6-module-loader/pull/387.

arv commented 9 years ago

Conceptually this looks good.

guybedford commented 9 years ago

Thanks, I've updated the PR.

arv commented 9 years ago

LGTM, I'll squash and merge

arv commented 9 years ago

Committed as 84956a25a6b05b0659b961e27d8a0313fd3372cf