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

[BUGFIX beta] Remove double loop over attrs to create a component. #12297

Merged
merged 1 commit into from
Sep 5, 2015

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Sep 4, 2015

Previously, we would loop over attrs and create additional objects for each entry then subsequently merge that "snapshot" back into a target object TWICE for initial render.

This updates to loop once over the attrs and do all the work needed in that one pass. It also avoids allocating two temporary objects and the extra Object.assign to merge them back into the target.

This doesn't have a giant impact on ef4/initial-render-perf (around 6%), but less work is less work and we will take any improvements we can get!

Previously, we would loop over `attrs` and create additional objects for
each entry then subsequently merge that "snapshot" back into a target
object TWICE for initial render.

This updates to loop once over the attrs and do all the work needed in
that one pass. It also avoids allocating two temporary objects and the
extra `Object.assign` to merge them back into the target.
rwjblue added a commit that referenced this pull request Sep 5, 2015
[BUGFIX beta] Remove double loop over attrs to create a component.
@rwjblue rwjblue merged commit db23f43 into emberjs:master Sep 5, 2015
@rwjblue rwjblue deleted the one-loop-during-create branch September 5, 2015 11:48
@sandstrom
Copy link
Contributor

Awesome! ⛵

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants