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] dramatically improve performance of eachComputedProperty #5212

Merged
merged 1 commit into from
Jul 24, 2014

Conversation

stefanpenner
Copy link
Member

ember-data relies heavily on eachComputedProperty. Recently it has grown to rely on eachComputedProperty much more. This was due to state bleed introduced by storing this state on the model constructor. Those issues can be fixed, but will be much more involved and since the list of computedProperties rarely (if ever changes) it should likely just be cached on consumption and rely on proper invalidation.

Invalidation occurs if additional properties are added via defineProperty or reopen. If an ancestor is given additional computed properties or reopened after the first eachComputedProperty invocation,it will not cause an invalidation. This last caveat is actually true throughout embers object model and as such it should be considered extremely dubious to reopen objects after the first instance has been created.
Conflicts:
packages/ember-runtime/lib/system/core_object.js

ember-data relies heavily on eachComputedProperty. Recently it has grown to rely on eachComputedProperty much more. This was due to state bleed introduced by storing this state on the model constructor. Those issues can be fixed, but will be much more involved and since the list of computedProperties rarely (if ever changes) it should likely just be cached on consumption and rely on proper invalidation.

Invalidation occurs if additional properties are added via defineProperty or reopen. If an ancestor is given additional computed properties or reopened after the first eachComputedProperty invocation,it will not cause an invalidation. This last caveat is actually true throughout embers object model and as such it should be considered extremely dubious to reopen objects after the first instance has been created.
Conflicts:
	packages/ember-runtime/lib/system/core_object.js
@rwjblue
Copy link
Member

rwjblue commented Jul 24, 2014

LGTM

rwjblue added a commit that referenced this pull request Jul 24, 2014
[Bugfix beta] dramatically improve performance of eachComputedProperty
@rwjblue rwjblue merged commit 8d9b0b3 into emberjs:master Jul 24, 2014
@stefanpenner stefanpenner deleted the faster-each-computed-property branch July 24, 2014 02:04
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