-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 ExtractPropertyFunction Allocations #4364
Reduce ExtractPropertyFunction Allocations #4364
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocked only on setup authoring.
@@ -33,6 +33,7 @@ | |||
|
|||
<PackageReference Include="System.Collections.Immutable" /> | |||
<PackageReference Include="System.Threading.Tasks.Dataflow" /> | |||
<PackageReference Include="System.Memory" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require some Setup Magic, so that we have it available in VS setup.
Notes for that: #3947, https://github.com/microsoft/msbuild/pull/3648/files#diff-ebf6dde28bf300b10540e8b71b872c5d.
Let's sync on that and pair through it (maybe next week while I'm there?).
functionBuilder.Arguments = functionArguments; | ||
functionBuilder.BindingFlags = defaultBindingFlags; | ||
functionBuilder.Remainder = remainder; | ||
functionBuilder.Remainder = remainder.ToString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this still shows as a hot spot for allocations, we'll probably have to tackle FunctionBuilder
's need to make these into real strings. But what you've done should help quite a bit and is a great start, so I think we should take this as-is.
@@ -161,6 +163,8 @@ folder InstallDir:\MSBuild\Current\Bin\amd64 | |||
file source=$(X86BinPath)Microsoft.Build.Framework.dll vs.file.ngenArchitecture=all | |||
file source=$(X86BinPath)Microsoft.Build.Tasks.Core.dll vs.file.ngenArchitecture=all | |||
file source=$(X86BinPath)Microsoft.Build.Utilities.Core.dll vs.file.ngenArchitecture=all | |||
file source=$(X86BinPath)System.Memory.dll vs.file.ngenArchitecture=all | |||
file source=$(X86BinPath)System.Numerics.Vectors.dll vs.file.ngenArchitecture=all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did RPS pass on your trial insertion to VS? This caused problems there last time. If it passed, awesome ;)
Superseded by #4394 |
Meant to fix #4085 but can't seem to repro & prove the fix works.
Reduced allocations by making use of ReadOnlySpan. Previous functionality saw lots of .Substring() and .Trim() calls on strings. Now they're being called on ReadOnlySpan and aren't turned into strings until needed at the end of the function.