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

[Performance]: Microsoft.Build.Evaluation.Expander can be more efficient by using Spans #10961

Open
1 of 2 tasks
ToddGrun opened this issue Nov 9, 2024 · 0 comments
Open
1 of 2 tasks
Labels
performance Priority:2 Work that is important, but not critical for the release triaged

Comments

@ToddGrun
Copy link

ToddGrun commented Nov 9, 2024

Issue Description

Noticed this while looking into a profile of VS solution load, particularly into string.Substring usage. ExpandPropertiesLeaveTypedAndEscaped showed up in this context, as about 0.3% of all allocations in VS during the solution load.

This led me to ping Rainer with the following questions, and he asked me to file this issue to track.

1) The substring call looks like it's done potentially twice, could the second call just use the existing value if it's not null?
2) The first calls ExpandRegistryValue with the substring value. It looks like that method could just take in a ReadOnlySpan<char> and use that.
3) The second calls ExpandPropertyBody with the substring value. This one has a lot of uses of that value, but again, it appears it might be ReadOnlySpan'able.
 
Also, there is the SplitFileSpec call which is a separate question. I assume that changing that to ReadOnlySpans isn't feasible?

Image

Steps to Reproduce

Open Roslyn.sln in VS

Data

The etl failed uploading several times. I've copied to an internal share: \vwdbuild01\dev\toddgrun\msbuild\PerfViewData.etl.zip

Analysis

No response

Versions & Configurations

VS 17.13

Regression

  • yes
  • no

Regression Details

No response

@maridematte maridematte added Priority:2 Work that is important, but not critical for the release triaged labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

No branches or pull requests

2 participants