I have a model which contains the nested model( like 3 l sub level).When this model has large dataset it takes a lot of time to finish execution. I found that the _setAttr function, especially the following code, take a long time for execution in the backbone-nested.js
following lines take a long time for execution in the backbone-nested.js file.
for (var a in obj) { if (obj.hasOwnProperty(a)) { nestedAttr = prefix + '.' + a; nestedVal = obj[a]; if (!_.isEqual(model.get(nestedAttr), nestedVal)) { model._delayedChange(nestedAttr, nestedVal, opts); } if (_.isObject(nestedVal)) { checkChanges(nestedVal, nestedAttr); } } }``
I have a model which contains the nested model( like 3 l sub level).When this model has large dataset it takes a lot of time to finish execution. I found that the _setAttr function, especially the following code, take a long time for execution in the backbone-nested.js
following lines take a long time for execution in the backbone-nested.js file.
for (var a in obj) { if (obj.hasOwnProperty(a)) { nestedAttr = prefix + '.' + a; nestedVal = obj[a]; if (!_.isEqual(model.get(nestedAttr), nestedVal)) { model._delayedChange(nestedAttr, nestedVal, opts); } if (_.isObject(nestedVal)) { checkChanges(nestedVal, nestedAttr); } }
}``Could you please help me to resolve this issue?