Last post Sep 27, 2016 03:25 AM by Yohann Lu
Sep 20, 2016 11:41 PM|issam1975|LINK
i am using Entity framework 6 Database first in an asp.net Web application (WebForm)
the main page of the website contain a login form that let the user to enter to the backend application .
as we know the first time we Create a datacontext and query the database it can be slow .
in my case it's when the website visitor try to login for the first time . and it's about 3/4 seconds (with very small edms model : 10 tables)
next EF queries are Instantaneous
so what's the strategies , tips and tricks to make the end user not noticing that first time setup and increase
any idea is welcome .
thanks and good day/night .
Sep 21, 2016 06:06 AM|Yohann Lu|LINK
According to your description ,as far as I know ,when first time query data , EF compiles the model . it will consume more time . that I find the following points may be useful to you :
1.Using a cached db model store
2.Generate pre-compiled views
3.Generate pre-compiled version of entityframework using n-gen to avoid jitting
For details , Please refer to this link:
3 steps for fast entityframework 6.1 code-first startup performance :
Sep 22, 2016 08:12 PM|issam1975|LINK
thanks a lot for the valuable hints .
1) i am on a shared web hosting, i have to check that but i doubt that i can do the NGEN trick .... can i ?
2) i have also found this page talking about enabling roslyn compiler in asp.net applications .
do you think that it can help in my case ?
Sep 24, 2016 08:15 AM|Yohann Lu|LINK
Roslyn compiler will improve application reduce the time of program execution.
Roslyn Compiler in Visual Studio 2015:
Sep 24, 2016 10:48 AM|issam1975|LINK
for the NGen trick :
after reading some pages and if i understand correctly :
i have to generate an optimized compiled version of the entity framework dll's with NGEN and upload them to my web host ?
sound correct to you ?
Sep 27, 2016 03:25 AM|Yohann Lu|LINK
Use Ngen will reduce wait time , but as far as I know , the effect is more obvious in large projects than in small.
Ngen.exe (Native Image Generator) - msdn.microsoft.com：