How to improve the performance of launching a large Entity Framework 4.0

In a project with 350 objects in the EDMX entity model, my team has long expectations when the first request occurs and when the first salvation occurs.

When profiling a simple case that executes multiple queries and saves, a simple set of steps to run the query and save takes several minutes.

The first request takes 47% of the total time just to call the framework method that executes the request.

The first save takes 50% of the total time only in System.Data.Objects.ObjectContext.SaveChanges.

Are there good opportunities for increasing productivity - this could be a development time leak.

(As soon as the system goes into production, it is annoying at startup, but is not a problem during the current execution)

+5
source share
2 answers

When you use a context for the first time, it generates a display model defined in the metadata. The option anticipates this model and includes the regenerated files in your application (but you must regenerate it every time you change EDMX).

Such a large model should probably be divided into several smaller models. I hardly believe that 350 objects form a single domain that cannot be divided.

+6
source

EDMX ObjectContext. , using(var ctx = new YourObjectContext()), , (, 350 ), . , , , .

WDMX EDMX ObjectContext. ObjectContext.

+1

All Articles