Skip to content

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.

_language = null;
if (_deltaDirty)
{
_delta = new SessionStateRecord[_maxNumberOfSessionStates];
Copy link
Contributor

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 the 3.0.0-preview1 milestone Feb 3, 2021
@cheenamalhotra cheenamalhotra merged commit b5d7bb6 into dotnet:master 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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants