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

Perf: Logging infra allocates even when no logging enabled. #11331

Closed
anpete opened this issue Mar 19, 2018 · 0 comments
Closed

Perf: Logging infra allocates even when no logging enabled. #11331

anpete opened this issue Mar 19, 2018 · 0 comments
Labels
area-perf closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@anpete
Copy link
Contributor

anpete commented Mar 19, 2018

ILogger has IsEnabled, which should normally be used to avoid doing logging work (building log messages etc.) when logging is disabled.

However, while profiling, I noticed that our logging infra. still seems to do the work, even when logging is disabled. One example is RelationalLoggerExtensions.CommandExecuted, which will allocate a string, a delegate, and several enumerators for each query execution.

@ajcvickers ajcvickers added this to the 2.1.0 milestone Mar 21, 2018
AndriySvyryd added a commit that referenced this issue Mar 23, 2018
Don't allocate for no-op logging

Fixes #11196
Fixes #11331
@AndriySvyryd AndriySvyryd removed their assignment Mar 23, 2018
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Mar 23, 2018
@ajcvickers ajcvickers modified the milestones: 2.1.0-preview2, 2.1.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-perf closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

3 participants