I am using an SQL CE Express database with a ClientProfile and AutoActivation in .NET 3.5. I have an Entity which contains a Start and End point. From a collection of objects I need to get a range. (The collection of objects are non-persistent objects.)
When benchmarking this the above operation takes about 200ms. Which is too slow for my liking. I changed it to the following:
The above operation takes less than 5ms. Is there a reason using the Entity's properties directly takes so long? I retrieved the object from the database ages ago, and the properties are not marked with LazyLoad. How can I speed this up? It's not doable in the current situation to use a ServerProfile. Using the second implementation in my software is not an option and the 190ms difference is noticeable when requesting the data in the application. |