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

Regression in single context creation perf #19864

Closed
ajcvickers opened this issue Feb 10, 2020 · 8 comments
Closed

Regression in single context creation perf #19864

ajcvickers opened this issue Feb 10, 2020 · 8 comments
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. punted-for-6.0

Comments

@ajcvickers
Copy link
Member

image

@smitpatel
Copy link
Member

Suspected commit according to meeting https://github.com/dotnet/efcore/pull/19517/files

Does initializing context also initializes DbSets even if not used?

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Feb 10, 2020

@smitpatel That's pretty much the only thing that happens before a context is used https://github.com/dotnet/efcore/blob/master/src/EFCore/DbContext.cs#L112

@AndriySvyryd
Copy link
Member

And if we can confirm that #19517 caused it we don't have or really can fix it

@roji
Copy link
Member

roji commented Feb 10, 2020

Should be really easy to simply run the benchmark on the cmdline on both commits to check (let me know if you run into trouble).

@smitpatel
Copy link
Member

Seems like @roji is volunteering to verify the commit for regression.

@roji
Copy link
Member

roji commented Feb 10, 2020

That was not quite the semantic content of my message... however:

Before change (f98509f)

BenchmarkDotNet=v0.11.3, OS=ubuntu 19.10
Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=3.1.100
  [Host] : .NET Core 3.1.1 (CoreCLR 4.700.19.60701, CoreFX 4.700.19.60801), 64bit RyuJIT

Toolchain=InProcessToolchain  
Method Mean Error StdDev Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
CreateAndDisposeUnusedContext 142.0 ms 1.142 ms 1.068 ms 34250.0000 - - 141.75 MB

After change (dd843a2)

BenchmarkDotNet=v0.11.3, OS=ubuntu 19.10
Intel Xeon W-2133 CPU 3.60GHz, 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=3.1.100
  [Host] : .NET Core 3.1.1 (CoreCLR 4.700.19.60701, CoreFX 4.700.19.60801), 64bit RyuJIT

Toolchain=InProcessToolchain  
Method Mean Error StdDev Median Gen 0/1k Op Gen 1/1k Op Gen 2/1k Op Allocated Memory/Op
CreateAndDisposeUnusedContext 193.7 ms 3.860 ms 9.825 ms 188.1 ms 38000.0000 - - 158.54 MB

For reference, running is super simple has no hard dependency on @roji:

  • cd benchmark/EFCore.Sqlite.Benchmarks (invert slashes if on exotic operating systems)
  • dotnet run -c Release -f netcoreapp3.1 -- --filter "*CreateAndDisposeUnusedContext*" --inProcess

@smitpatel
Copy link
Member

That was not quite the semantic content of my message... however:

Oops! My mistake! 😉

@AndriySvyryd AndriySvyryd removed this from the 5.0.0 milestone Feb 10, 2020
@ajcvickers ajcvickers added this to the 5.0.0 milestone Feb 17, 2020
@ajcvickers
Copy link
Member Author

I have ideas.

@ajcvickers ajcvickers modified the milestones: 6.0.0, MQ Aug 18, 2021
@ajcvickers ajcvickers removed their assignment Nov 10, 2021
@ajcvickers ajcvickers removed this from the MQ milestone Nov 10, 2021
@ajcvickers ajcvickers added the closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. label Mar 10, 2022
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. punted-for-6.0
Projects
None yet
Development

No branches or pull requests

4 participants