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

ListMixin contains calls the length getter twice per iteration #30478

Closed
leafpetersen opened this issue Aug 17, 2017 · 0 comments
Closed

ListMixin contains calls the length getter twice per iteration #30478

leafpetersen opened this issue Aug 17, 2017 · 0 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.

Comments

@leafpetersen
Copy link
Member

Unlike other iteration functions in ListMixin, contains use the length getter in the header of the for loop instead of using the local variable that stores the length on entry. Combined with the the additional check for concurrent modification, this means that the length getter is called twice per iteration. dart2js is not able to inline and optimize this code, at least in large internal customer apps.

Filed #30477 for the concurrent modification check, but at least only checking once per iteration would probably be good.

@leafpetersen leafpetersen added the area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. label Aug 17, 2017
@lrhn lrhn closed this as completed in 0194b34 Aug 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
Projects
None yet
Development

No branches or pull requests

1 participant