Skip to content

Conversation

@rvs1257
Copy link

@rvs1257 rvs1257 commented Sep 30, 2022

EF query tuning, including DeepEquals to ensure equivalent result.

Additional context and method for an indexed copy of the database.

image

@rvs1257
Copy link
Author

rvs1257 commented Oct 5, 2022

Interesting to see how fast EF 7 is, my SQL is slower when run without additional indexing.
image

@qjustfeelitp
Copy link

YAY! Glad to see, that someone tried compiled queries! I would also use pooled DB context for max perf and almost zero allocation, using static DB context is quite dangerous, if it would be used in all places in some kind of app, but I guess for this benchmark it's OK?
It's worth mentioning that EF has perf guidance https://learn.microsoft.com/en-us/ef/core/performance/advanced-performance-topics?tabs=without-di%2Cwith-constant
So, the way to go is the compiled model, pooled DB context and compiled queries. Compiled queries are recommended for HOT PATHS.

@rvs1257
Copy link
Author

rvs1257 commented Oct 6, 2022

@qjustfeelitp thanks for the feedback, the static context was for performance at any cost, but the pooling seems to add very little overhead.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants