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

Reduce allocation in query for execution strategy #24208

Merged
merged 2 commits into from
Feb 23, 2021

Conversation

roji
Copy link
Member

@roji roji commented Feb 20, 2021

No description provided.


return result;
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this is false?

Copy link
Member Author

Choose a reason for hiding this comment

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

Why was it true before? :trollface:

Doesn't matter, it's not used :) I can make it true if we care.

Copy link
Contributor

@smitpatel smitpatel Feb 22, 2021

Choose a reason for hiding this comment

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

Why was it true before?

Don't know. :trollface:
I am a bot, I question for changes only disregarding correctness of old code. 😉

Can use whatever if the value is irrelevant. Curiosity why not void if value is not used.

Copy link
Member Author

Choose a reason for hiding this comment

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

Only because Execute/ExecuteAsync return TResult, and C# doesn't allow void.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could have overloads which don't return TResult, but...

@ghost
Copy link

ghost commented Feb 22, 2021

Hello @roji!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@roji roji removed the auto-merge label Feb 22, 2021
Copy link
Contributor

@smitpatel smitpatel left a comment

Choose a reason for hiding this comment

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

Wish there was an analyzer to catch all such issues. 🚜

@roji
Copy link
Member Author

roji commented Feb 23, 2021

Maybe this? https://marketplace.visualstudio.com/items?itemName=MukulSabharwal.ClrHeapAllocationAnalyzer

For Resharper/Rider, there's the great Heap Allocations Viewer which underlines all allocations.

@roji roji merged commit ec6be85 into main Feb 23, 2021
@roji roji deleted the ExecutionStrategyAllocation branch February 23, 2021 00:05
@roji
Copy link
Member Author

roji commented Feb 23, 2021

I basically just get very, very alert when I'm around lambdas.

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.

Improve EF Core (non-tracking) query performance on TechEmpower Fortunes
2 participants