Remove some overhead from Process.Start#44691
Merged
stephentoub merged 1 commit intodotnet:masterfrom Nov 17, 2020
Merged
Conversation
|
Tagging subscribers to this area: @eiriktsarpalis, @jeffhandley DetailsIssue Details
|
jkotas
reviewed
Nov 15, 2020
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeProcessHandle.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Nov 15, 2020
src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Nov 15, 2020
...aries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Nov 15, 2020
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs
Outdated
Show resolved
Hide resolved
2713e01 to
7d480dd
Compare
jkotas
reviewed
Nov 15, 2020
src/libraries/System.Security.Principal.Windows/src/System.Security.Principal.Windows.csproj
Outdated
Show resolved
Hide resolved
jkotas
approved these changes
Nov 15, 2020
7d480dd to
ffb28f7
Compare
ffb28f7 to
0ca7ba1
Compare
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/PasteArguments.Unix.cs
Outdated
Show resolved
Hide resolved
Member
|
/azp run runtime-libraries outerloop |
|
No pipelines are associated with this pull request. |
stephentoub
commented
Nov 17, 2020
src/libraries/System.Private.CoreLib/src/System/PasteArguments.Unix.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Nov 17, 2020
jkotas
reviewed
Nov 17, 2020
Member
|
Build break |
- Avoid StringBuilder marshaling
- Let CreateProcess{WithLogonW} determine the current working directory
- Avoid creating SafeHandles for GetCurrentProcess()
- Avoid forcing ProcessStartInfo.ArgumentList into existence just to check if it contains anything
- Prefer using ProcessStartInfo.Arguments in Start(string, IEnumerable<string>) if there's only one string in the enumerable
- Use ValueStringBuilder instead of StringBuilder to build up arguments, so as to use stack space / pooled char[]s and avoid actually needing to produce strings.
- Avoid unnecessary SafeHandle for PROCESS_INFORMATION.hThread
ba1ecbd to
8b2bab4
Compare
Member
Author
What happens when you search within *.csproj and forget about *.projitems ;-) |
This was referenced Nov 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Test that launches a thousand processes, no redirection, one argument (execution time is dominated by the actual native call and remote process, so this has a negligible impact on serial execution time):
Allocations before

Allocations after

Contributes to #44598