afeld / backbone-nested

A plugin to make Backbone.js keep track of nested attributes - looking for maintainers! https://github.com/afeld/backbone-nested/issues/157
https://afeld.github.com/backbone-nested/
MIT License
443 stars 83 forks source link

_runDelayedTriggers performance issue #161

Open dpmragu opened 7 years ago

dpmragu commented 7 years ago

I am facing performance issue when I load a large number of data set from my application. I used javascript profiler to identify the root cause. And found that one of the function _runDelayedTriggers() took long time in the backbone-nested.js(line number : 233) . Please refer the below screenshot that captured from Javascript profiler.

Can you please someone help to resolve this issue?

image

image

McBoof commented 6 years ago

We've had the same issue and will supply a patch for this. The issue is that shift() is REALLY slow on a huge array. We've seen 15 secs just to shift() and array to nothing vs 3 ms to loop over it.