Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(ivy): avoid for-of loops at runtime #32157

Conversation

@AndrewKushnir
Copy link
Contributor

commented Aug 15, 2019

TypeScript downlevels for-of loops for ES5 targets. As a result, generated output contains extra code, including a try-catch block, which has code size and performance implications. This is especially important for runtime code where we want to keep it as small as possible. This commit changes for-of loops in runtime code to regular for loops.

PR Type

What kind of change does this PR introduce?

  • Other... Please describe: performance improvement.

Does this PR introduce a breaking change?

  • Yes
  • No
perf(ivy): avoid for-of loops at runtime
TypeScript downlevels `for-of` loops for ES5 targets. As a result, generated output contains extra code, including a try-catch block, which has code size and performance implications. This is especially important for runtime code where we want to keep it as small as possible. This commit changes `for-of` loops in runtime code to regular `for` loops.

@AndrewKushnir AndrewKushnir requested a review from angular/fw-core as a code owner Aug 15, 2019

@ngbot ngbot bot modified the milestone: needsTriage Aug 15, 2019

@googlebot googlebot added the cla: yes label Aug 15, 2019

@alfaproject

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2019

That's only true if you enable downlevelIteration in tsconfig.json, but why would you enable that?

Eg http://www.typescriptlang.org/play/index.html?target=1#code/GYewTgBAFAxiB2BnALhApgGwiYEDaAugJQQDeAsAFAQRxIgZoB0GIA5lJkQNxUC+VIA

@AndrewKushnir

This comment has been minimized.

Copy link
Contributor Author

commented Aug 15, 2019

ngdevelop-tech added a commit to ngdevelop-tech/angular that referenced this pull request Aug 27, 2019
perf(ivy): avoid for-of loops at runtime (angular#32157)
TypeScript downlevels `for-of` loops for ES5 targets. As a result, generated output contains extra code, including a try-catch block, which has code size and performance implications. This is especially important for runtime code where we want to keep it as small as possible. This commit changes `for-of` loops in runtime code to regular `for` loops.

PR Close angular#32157
sabeersulaiman added a commit to sabeersulaiman/angular that referenced this pull request Sep 6, 2019
perf(ivy): avoid for-of loops at runtime (angular#32157)
TypeScript downlevels `for-of` loops for ES5 targets. As a result, generated output contains extra code, including a try-catch block, which has code size and performance implications. This is especially important for runtime code where we want to keep it as small as possible. This commit changes `for-of` loops in runtime code to regular `for` loops.

PR Close angular#32157
@angular-automatic-lock-bot

This comment has been minimized.

Copy link

commented Sep 16, 2019

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 16, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.