Page 1 of 1

Entity Framework 6 Performance

Posted: Thu 17 Jul 2014 08:58
by david.tuke
Hi All;

Experiencing very slow "cold" reads - ie first read very slow 6-8 seconds:

DBSet.FIND(1) takes very long on first read; thereafter okay (ms) but first time very slow

Any Ideas?

Re: Entity Framework 6 Performance

Posted: Mon 21 Jul 2014 15:04
by Shalex
We recommend you to try increasing performance in the following way:
1) employ pre-generated views (http://msdn.microsoft.com/en-us/library/bb896240.aspx) which improve startup time. With Entity Developer (the Devart Entity Model item, *.edml) the feature can be turned on via the View Generation option of EntityContextModel
2) optimize your large tables
a) it is better if the primary key of the table is autoincremental Number. In this case, .Skip(x).Take(y) could be replaced with fastest .Where(t => t.Id >= x && t.Id < x + y)
b) create and place an optimized query in a stored procedure which returns a cursor. Then add this stored procedure in your model and conrol the stored procedure behaviour via its parameters

If you need any further information, please tell us:
a) model type you are using (ADO.NET Entity Data Model *.edmx or Devart Entity Model *.edml)
b) your approach - Code-First, Model-First or Database-First
с) XML mapping or fluent mapping?
d) the version (x.x.x) of your Entity Framework
e) the version (x.x.x) of your dotConnect for DB2