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

Query compilation performance - Part 2 #971

Merged
merged 6 commits into from
Oct 29, 2019
Merged

Conversation

chrfin
Copy link
Contributor

@chrfin chrfin commented Jul 2, 2019

This is an update to #430 with the addition to be able to configure or completely disable the query optimizations as already discussed in the initial pull request.

@dnfclas
Copy link

dnfclas commented Jul 2, 2019

CLA assistant check
All CLA requirements met.


namespace System.Data.Entity.Utilities
{
internal class IntegerSwitch : Switch
Copy link
Contributor

@divega divega Jul 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrfin, @ajcvickers do you know how usable is System.Diagnostics.Switch on .NET Core? From what I remember the last time I used one of these you configured in the app.config, but that isn't operational in .NET Core, so, are there other alternatives?

Copy link
Contributor Author

@chrfin chrfin Jul 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good point. I used a Switch because the PlanCompiler class already uses BooleanSwitch (see _applyTransformationsRegardlessOfSize)...
I'll check it and if not working on .NET Core replace all (incl. the "old one") of them and update the pull-request.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajcvickers @divega I checked it and Diego is right. Switch is useless in .NET Core as it is only working in-memory per instance.
Now I'm not sure in which direction I should go:

  1. Improve the Switch-implementation in CoreFX to be usable
  2. Create a new Switch-implementation outside of CoreFX based on Microsoft.Extensions.Configuration (where could/should that be added? new package?)
  3. Add Microsoft.Extensions.Configuration to EF6 and use the new config-system instead of the switches
  4. Implement some global/static settings directly in EF6 changeable via code

What do you think?
The best solution IMO would be using Microsoft.Extensions.Configuration in the CoreFX-Switch, but that is not possible AFAIK, or is it somehow?

Copy link
Contributor

@divega divega Jul 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajcvickers or @bricelam may have good suggestions for this. Just some toughs:

I am not sure why the code in PlanCompiler uses BooleanSwitch. It is a decision that was made a long time ago when we didn't envision the possibility of running on .NET Core (or we didn't envision .NET Core for that matter 😄), but also it sounds like a setting a user may want to change for non-diagnostic reasons. We could also add an AppSetting option for this one.

@chrfin
Copy link
Contributor Author

chrfin commented Jul 10, 2019

@divega @ajcvickers @bricelam I now changed it to use ConfigurationManager.AppSettings.
I also changed the existing switch - if that is a non-desired breaking-change please tell me and I revert that part...

@chrfin
Copy link
Contributor Author

chrfin commented Aug 24, 2019

@divega May you can take another look? Thanks

@chrfin
Copy link
Contributor Author

chrfin commented Sep 5, 2019

@divega @ajcvickers @bricelam Ping after preview 9 ☺

@divega
Copy link
Contributor

divega commented Sep 5, 2019

@chrfin sorry for not responding earlier. We looked superficially at the PR and it is looking good, though we may need to do another pass to provide feedback.

I just wanted to answer if this will make it into 6.3: at this time in a release (i.e. with no more previews in sight) we tend not to take changes of this nature as a heuristic to avoid introducing regressions in the last minute. Based on this, I would like us to consider this for the next release.

@chrfin
Copy link
Contributor Author

chrfin commented Sep 6, 2019

Thanks for the feedback and I completely understand your reasoning :-)

@divega
Copy link
Contributor

divega commented Sep 7, 2019

@chrfin speaking of which, we will sadly have to revert the previous compilation perf improvement because of #1217 😢 We will of course consider it for the next release as well, once we have time to understand what caused it to break things.

@chrfin
Copy link
Contributor Author

chrfin commented Sep 7, 2019

@divega Sad to hear, but also understandable. Could you may keep the lowered MaxNodeCountForTransformations in, as this is already a huge improvement for my app (without that I could not use 6.3 final and would stick to the previews).
I will also take a look at #1217 to may get the changes back in at the first 6.4 preview...

@divega
Copy link
Contributor

divega commented Sep 7, 2019

cc @bricelam

@ajcvickers ajcvickers merged commit 4a03966 into dotnet:master Oct 29, 2019
@ajcvickers
Copy link
Member

Thanks for the contribution!

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.

4 participants