tonysneed/trackable-entities — pull request #17 by azabluda (2014-12-15 13:19:48+00:00)
Title: New implementation of ChangeTrackingCollection.GetChanges

- Only changed entities are cloned. This seems more memory efficient compared to the original method which would first clone everything then chop off the unchanged nodes
- Doesn't remove items from collections and doesn't nullify any reference navigation props. Both operations may cost us performance if the setters aren't trivial, may even be dangerous in terms of possible side effects. E.g. confuse the automatic navigation property fix-up mechanism (if the client implementation provides one)

The main idea:
1. First inspect the source collection in read-only mode
2. Collect necessary information about unchanged nodes
3. Serialize the source collection skipping the unchanged nodes
4. Deserialize