-
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
CollectionView: Reorder DOM elements after sorting #1979
Comments
👍 Nice work, @ptbrowne! Would you be interested in making a PR? I can see this working in situations where we can be 100% sure that the other models in the collection are unchanged. Also, because this changes the behavior in a breaking, though more efficient, way, we'll have to throw this into a major release. v4 is all about views, but this is a friendly enough change that I can see it landing in v3. |
Cool. Sure, I will do the PR :) |
@ptbrowne any word on the PR? |
I am pretty busy at the moment but I will try to do that this week. Sorry On Wed Feb 04 2015 at 2:58:36 AM Sam Saccone notifications@github.com
|
fixed in 2.4 |
Hi,
I have just set up a proof of concept to increase the performance of re-rendering large CollectionView after sorting. The default behavior is to re-render but this seems very inefficient since the templates are already rendered and inserted in the DOM. My approach is simple but it seems to deliver good results: I basically detach all children' $el and reinsert them in the order of the collection.
I have had more than 10x perf increase and it should be more if the template is complicated. If you click on profile in the jsBin, you will be able to see that in Chrome Profiler.
I wonder what do you think, if this technique has any flaws (beside the fact that if the template or itemViewOptions use the index, it will not work as expected). I am open to critics.
Here is the jsBin: http://jsbin.com/vecobada/13/edit
Thanks for Marionette !
The text was updated successfully, but these errors were encountered: