For very large collections of dependent entities (> 10000) there is required significant time to access EntityCollection for the first time. The problem is most probably caused by multiple invocations of Contains method on List<T> Entities property in EntityCollection class.
The sample execution time for 32011 dependent entities is: 5907ms.
The solution for the problem might be to introduce additional HashSet which is synchronised with Entities and execute Contains method on it instead of List<T>.Contains.
Comments: Corresponding PR can be found at: https://openriaservices.codeplex.com/SourceControl/network/forks/raspranav/domaindatasource/contribution/8621 The pr will probably be accepted but we should have a quick look at the perf for smaller collections as well as ensure that all tests passes.
The sample execution time for 32011 dependent entities is: 5907ms.
The solution for the problem might be to introduce additional HashSet which is synchronised with Entities and execute Contains method on it instead of List<T>.Contains.
Comments: Corresponding PR can be found at: https://openriaservices.codeplex.com/SourceControl/network/forks/raspranav/domaindatasource/contribution/8621 The pr will probably be accepted but we should have a quick look at the perf for smaller collections as well as ensure that all tests passes.