Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Don't set AsyncLocal for scope if not included#715

Closed
benaadams wants to merge 2 commits intoaspnet:devfrom
benaadams:asynclocal
Closed

Don't set AsyncLocal for scope if not included#715
benaadams wants to merge 2 commits intoaspnet:devfrom
benaadams:asynclocal

Conversation

@benaadams
Copy link
Contributor

@benaadams benaadams commented Sep 23, 2017

Don't disturb the ExecutionContext if scopes aren't being used as it wildly increases allocations

Without ConsoleLogger (no changes to AsyncLocal)

With ConsoleLogger and no scopes - but not logging anything (changes to AsyncLocal)

You can see the allocations of Action and MoveNextRunner disproportionately increase; prior to this change

Resolves #714

/cc @davidfowl

You are right @anurse, logging allocations make me sad 😢

@BrennanConroy
Copy link
Member

Lets say you enable scopes after you're already in a scope, you now lose information for the logs in that scope until you leave and renter it. Not sure how important of a scenario that is though.

@ghost ghost removed the cla-already-signed label Nov 14, 2017
@benaadams
Copy link
Contributor Author

Lets say you enable scopes after you're already in a scope, you now lose information for the logs in that scope until you leave and renter it. Not sure how important of a scenario that is though.

The start events won't be in a scope either

@analogrelay
Copy link
Contributor

Yeah, in that scenario, in-progress scopes are already messed up anyway. I don't think optimizations like this would cause any more problems.

@benaadams
Copy link
Contributor Author

I think this has been resolved by resolved by #723?

@benaadams benaadams closed this Jan 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants