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

tiny perf change #900

Merged
merged 1 commit into from Feb 3, 2021
Merged

tiny perf change #900

merged 1 commit into from Feb 3, 2021

Conversation

Wraith2
Copy link
Contributor

@Wraith2 Wraith2 commented Feb 3, 2021

in #889 there was one item which generated a huge number of arrays and discarded them causing GC pressure. I tracked and identified all uses of the code that generates it. There is only one SessionStateRecord used and no other location keeps a reference to it so it is safe to clear the array for re-use instead of creating and entirely new one each time.

@@ -82,7 +82,7 @@ public void Reset()
_language = null;
if (_deltaDirty)
{
_delta = new SessionStateRecord[_maxNumberOfSessionStates];
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch on call to GC and allocations.

@cheenamalhotra cheenamalhotra added this to In Progress in SqlClient v3.0 via automation Feb 3, 2021
@cheenamalhotra cheenamalhotra added this to the 3.0.0-preview1 milestone Feb 3, 2021
@cheenamalhotra cheenamalhotra merged commit b5d7bb6 into dotnet:master Feb 3, 2021
SqlClient v3.0 automation moved this from In Progress to Done Feb 3, 2021
@Wraith2 Wraith2 deleted the perf12 branch February 5, 2021 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants