Slow Performance on Entity Framework
Hi, I am not sure where to post this issue. I have concern on the slow performance of Entity Framework. I have a web application project related to stock trading and the traffic is very busy and very fast all the time. At first I was trying to use EF 6 as the ORM framework, but after half year usage of the app and more and more user uses it, the app becomes slower and eventually crash. After conduct some investigation, I found out that Database usage is still light and actually EF operation is the bottleneck. I try to optimize the app by converting some complex LINQ/Lambda query to pure SQL query. Some issue are relieved by the optimization, but user still complains that it is still slow. After doing research on other library, I found out that Dapper is suitable for high-traffic web site, then I have no choice but to combine between EF and Dapper for ORM framework.
During my research, I try to simulate simple query and observe the speed of pure SQL query, but it turns out that query using EF is much slower than that using Dapper.

I like the design of Entity Framework and plan to use it for high-traffic web application, but could you please to optimize the speed performance for the release of EF Core?
Thank you.
Your test isn't accurate for multiple reasons.
A. You should ignore the first query as there are many bootstrapping going in then. B. First query inserts the data into the RAM, so the following one will be much faster. C. There's the garbage collection issue too that you need to isolate.
To add more to above list, you are creating context after starting timer, first time context creation will create the model from scratch and many other services are initialized which are not related to query.
If EF 6 was indeed the bottleneck, don't use EF core, currently it's much worse, but even when things will stable, it won't be much faster.
You are much better using Dapper.
(Representing only myself, I'm not a Microsoft employee)
But I'm not sure that even Dapper or raw ADO.NET will save you, you probably need to add a Redis caching layer (I worked in stock trading in the past)
There isn't really anything actionable in this issue, so we are closing it out. If you have specific code listings that you think are executing poorly on EF Core, then please open an issue with the runnable code listing and the times you are seeing.