-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Batch record arrays #4849
Batch record arrays #4849
Conversation
d8d72ab
to
375590d
Compare
This is ready to review. |
|
||
To avoid thrashing, it only runs at most once per run loop. | ||
let models = pending[modelName] = pending[modelName] || []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should happen after 100
|
||
recordArrays.forEach(array => array._removeInternalModels([internalModel])); | ||
Object.keys(pending).forEach(modelName => { | ||
let work = pending[modelName].map(internalModel => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internalModelsToBeProcessed
|
||
// process adapterPopulatedRecordArrays | ||
if (modelsToRemove.length > 0) { | ||
this.removeFromRemainingRecordArrays(modelsToRemove); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to removeFromAdapterPopulatedRecordArrays
375590d
to
95d0eac
Compare
95d0eac
to
f48e473
Compare
batch additions / updates to all record arrays
test in a real app (emberaddons.com, much faster no more n+1 arrayChange events when adding/updating recordArrays)
add tests to ensure no regression re reduced number of array change vents
restore test https://github.com/emberjs/data/pull/4849/files#diff-4663f105651a747eef0a3b68ae951fc3R285