-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve EF Core (non-tracking) query performance on TechEmpower Fortunes #23611
Comments
All benchmarks executed on aspnet-citrine-lin (TechEmpower hardware), 3 iterations. Summary
Detailed changes
Previous figures with aspnet-perf-lin (weaker machine)Overview
Detailed changes
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Here's the memory reduction info. The following includes only improvements done between EF Core 5 and 6: no benchmark code changes or .NET-related changes, but including some minor Npgsql improvements.
|
Here's a comparison with and without EF's compiled query feature:
So disabling compiled queries reduces perf by 3.8%. Not a lot, but it's worth mentioning the that the Fortunes query itself is as minimal as can be (just enumerate the DbSet - no operators, no parameters); as the query becomes more complex, the gap will increase. Crank cmdlinesWith compiled:
Without compiled:
/cc @ajcvickers |
Reran the numbers for EF5 vs. EF6, .NET 5 vs. .NET 6. All these use the latest version of the benchmarks - this includes the new connection string to use multiplexing and MaxPoolSize=18 (aspnet/Benchmarks#1667).
Note I'm seeing less of an improvement than previously by going from .NET 5 to .NET 6 (5.47% only compared to 9.8% previously), possibly due to the multiplexing/MaxPoolSize change.
|
@roji Whenever you work on this again I think it could be beneficial to determine where Dapper is benefitting from the move to .NET 6 in case a similar optimization can be applied to EF Core. |
I reran .NET 5 vs. .NET 6 for Dapper with the same benchmark version, to make sure we compare apples to apples (so with multiplexing and MaxPoolSize=18). I still see around the same improvement as before, even a bit more (16% instead of 14.3%).
Sure, though that's not a trivial question to answer... :) |
Am closing this for now, as we've achieved good results for 6.0 and don't have immediate plans for further work. |
We have been running the industry standard TechEmpower benchmarks on .NET against a PostgreSQL database for several years. In particular, the Fortunes benchmark is particularly relevant to EF scenarios. We have multiple variations of this benchmark, including:
The goal for EF Core 6.0 is to get the EF Core performance to match that of Dapper on the TechEmpower Fortunes benchmark. This is a significant challenge which may not be fully achieved in EF Core 6.0. Nevertheless, we will get as close as we can.
The text was updated successfully, but these errors were encountered: