Skip to content
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

Provide opt-in way to disable snapshotting/resetting for DbContext pooling #24769

Open
roji opened this issue Apr 26, 2021 · 1 comment
Open
Assignees
Labels
area-dbcontext area-perf punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-enhancement
Milestone

Comments

@roji
Copy link
Member

roji commented Apr 26, 2021

Instead of using the built-in context pooling, I experimented with a non-resetting context pool which simply hands out instances without any state resetting etc.; this yielded a 1.8% perf increase. We can add an opt-in flag to DbContext pooling that would likely get use close to that.

Note similarity with Npgsql's No Reset On Close, which does the same at the ADO connection pooling level.

@roji roji self-assigned this Apr 26, 2021
@ajcvickers ajcvickers added this to the Backlog milestone Apr 29, 2021
@roji roji changed the title Add flag to disable snapshotting/resetting for DbContext pooling Provide opt-in way to disable snapshotting/resetting for DbContext pooling Apr 30, 2021
@roji
Copy link
Member Author

roji commented Apr 30, 2021

We could add this as a flag, but it would be better to move the snapshotting/resetting logic to a place which the user can override, and simply not call them. #24768 and #24797 could go in this direction.

@ajcvickers ajcvickers modified the milestones: Backlog, 7.0.0 Oct 25, 2021
@ajcvickers ajcvickers added punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. and removed propose-punt labels Apr 23, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0, Backlog Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dbcontext area-perf punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-enhancement
Projects
None yet
Development

No branches or pull requests

2 participants