Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Optimize ngRepeat by using the new CD #751

Closed
wants to merge 2 commits into from

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Mar 18, 2014

The current algo used to prevent moves is not really smart.

Things left:

  • to go from [1 2 3 4] to [2 3 4 1] requires 3 moves (2, 3, 4) while one (1) should be enough. I'll check how the react guys do this and try to optimize further.
  • the first iteration is a special case as collection changes are not reported as addition the first (only the content of the list is reported). I'll try to have the changes reported as additions so that the special case could be removed.

The first item is not worth handling.

The second will be handled in a further PR

@vicb vicb added cla: yes and removed cla: no labels Mar 18, 2014
@vicb
Copy link
Contributor Author

vicb commented Mar 18, 2014

@mhevery I don't think the first item (minimize moves) really belongs here but it should be integrated into the CD. What do you think ?

@mhevery
Copy link
Contributor

mhevery commented Mar 20, 2014

I think that CD computes things in consistent way, and that is that things can only move forward not backwards. To get a minimum set would require algorithm worse then O(n).

Will try to merge this in tomorrow.

@vicb
Copy link
Contributor Author

vicb commented Mar 20, 2014

Rebase on top of master.

I have created an issue to be sure not to forget about updating the CD to report additions.

@vicb
Copy link
Contributor Author

vicb commented Mar 20, 2014

@mhevery please merge #758 first, it will be help (I have a rebased version of this PR I can force push then). Thanks.

@vicb
Copy link
Contributor Author

vicb commented Mar 21, 2014

@mhevery This PR can be merged. Travis is OK on my repo.

I'll work on the release announcement and #758 from now.

@mhevery
Copy link
Contributor

mhevery commented Mar 25, 2014

MERGED 09871cb

@mhevery mhevery closed this Mar 25, 2014
@vicb vicb deleted the 20140314-ngRepeat branch March 31, 2014 08:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants