You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It takes a while (3 minutes+) to 'create/compile' my DbContext. The web server starts in about 5 seconds, but when I do the first query to my database, EF 2.0 has to 'build/create/compile' the database in memory or something, I think? The next requests are almost instant. This was a Database First creation of the DbContext, the database already exists in MSSQL and has data. The DbContext contains about 500 DbSet's with relations.
Is there a way to speed this up by doing the 'creation' of my Entity Framework's DbContext before running the web server (at developmenttime), create the file/mappings it needs, so the first request is fast too?
The web application itself starts in about 5 seconds, which is acceptable. It's the first query through EF Core 2.0 that takes 3 minutes+. If I just show a HTML page, it is loaded after about 5 seconds. The same if I use ADO.NET, the query is shown after 2 seconds. It's the first query (even a simple db.Articles.FirstOrDefault()) that takes 3 minutes+, the subsequent query (any query) takes a normal 100ms or something.
I've tried this in debug as well as release.
Because probably EF is bootstrapping itself, which I'm asking if the result of this bootstrap can be cached, so that EF does not need to rebuild the whole bootstrap every run and instead read the cached version.
Further technical details
EF Core version: 2.0.0 (was same result on 1.1.2
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: tested on Windows 8, Windows 10, Windows Server 2016, Windows Server 2012 R2, same result on all
IDE: Visual Studio 15.3.5 (2017) Pro
The text was updated successfully, but these errors were encountered:
@nfdevil There isn't anything like this at the moment--we are tracking some ideas as #1906. When working on this (or just doing model building perf work in general) it is useful to use a variety of larger models since there are many factors (annotations, number of relationships, etc.) that can impact model building perf. Would it be possible for you to share your model with us? If you don't want to post it on github, then feel free to email it to me--I am "avickers" working at microsoft.com.
It takes a while (3 minutes+) to 'create/compile' my DbContext. The web server starts in about 5 seconds, but when I do the first query to my database, EF 2.0 has to 'build/create/compile' the database in memory or something, I think? The next requests are almost instant. This was a Database First creation of the DbContext, the database already exists in MSSQL and has data. The DbContext contains about 500 DbSet's with relations.
Is there a way to speed this up by doing the 'creation' of my Entity Framework's DbContext before running the web server (at developmenttime), create the file/mappings it needs, so the first request is fast too?
The web application itself starts in about 5 seconds, which is acceptable. It's the first query through EF Core 2.0 that takes 3 minutes+. If I just show a HTML page, it is loaded after about 5 seconds. The same if I use ADO.NET, the query is shown after 2 seconds. It's the first query (even a simple db.Articles.FirstOrDefault()) that takes 3 minutes+, the subsequent query (any query) takes a normal 100ms or something.
I've tried this in debug as well as release.
Because probably EF is bootstrapping itself, which I'm asking if the result of this bootstrap can be cached, so that EF does not need to rebuild the whole bootstrap every run and instead read the cached version.
Further technical details
EF Core version: 2.0.0 (was same result on 1.1.2
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: tested on Windows 8, Windows 10, Windows Server 2016, Windows Server 2012 R2, same result on all
IDE: Visual Studio 15.3.5 (2017) Pro
The text was updated successfully, but these errors were encountered: