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 allocations in ItemGroupLoggingHelper.GetParameterText #5211

Closed
KirillOsenkov opened this issue Mar 31, 2020 · 6 comments
Closed

Reduce allocations in ItemGroupLoggingHelper.GetParameterText #5211

KirillOsenkov opened this issue Mar 31, 2020 · 6 comments
Assignees
Milestone

Comments

@KirillOsenkov
Copy link
Member

See related:
#4907

This is really inefficient and allocates too much.

@KirillOsenkov KirillOsenkov self-assigned this Mar 31, 2020
@KirillOsenkov KirillOsenkov added Good First Issue Self-contained issues good for first-time contributors. performance Performance-Scenario-Build This issue affects build performance. help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. labels Mar 31, 2020
@KirillOsenkov
Copy link
Member Author

Oops, this could be a dupe of #2200

@KirillOsenkov
Copy link
Member Author

Looks like the Universe wants me to fix this perf issue

@KirillOsenkov
Copy link
Member Author

#5217

@KirillOsenkov
Copy link
Member Author

#5218

@KirillOsenkov
Copy link
Member Author

This is mostly fixed, but I want to repurpose this issue to see if I can get rid of having a StringBuilder in the first place. If we just pass the parameters and items with metadata directly to the loggers (on the TaskStartedEventArgs presumably), then the loggers will not need to allocate the strings altogether, they'll write into their streams directly.

We can have the method that produces these strings on the Args in case the logger still wants the strings.

We'll need to think how to make this change backwards compatible, such that the loggers that are unaware of this change still get the exact same behavior as before.

But certainly I'd like to optimize this throughput for binary logger to minimize the allocation overhead.

@KirillOsenkov KirillOsenkov added Area: Logging and removed Good First Issue Self-contained issues good for first-time contributors. help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. labels Apr 9, 2020
@KirillOsenkov
Copy link
Member Author

Fixed by #6155

@ladipro ladipro added this to the MSBuild 16.10 milestone Dec 9, 2021
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants