Skip to content

Perf: Windows cmd.exe /D to avoid registry check - #2852

Merged
jeffkl merged 5 commits into
dotnet:masterfrom
erikmav:dev/erikmav/cmdDashD
Jan 23, 2018
Merged

jeffkl merged 5 commits into
dotnet:masterfrom
erikmav:dev/erikmav/cmdDashD

Conversation

@erikmav

@erikmav erikmav commented Jan 10, 2018

Copy link
Copy Markdown
Contributor

When spawning Windows cmd.exe shell commands, add the /D parameter to avoid the overhead of checking the autorun configuration in the registry

@dnfclas

dnfclas commented Jan 10, 2018 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@rainersigwald rainersigwald left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This is definitely How It Should Have Been, for reliability as well as performance reasons. See Raymond Chen on autoruns.

Unfortunately, I could envision a scenario where someone has an autorun that is actually critical to their build--they might execute a tool by tool.exe in an <Exec> that depends on having PATH set by an autorun command.

I don't know how to judge the risk of that theoretical break. @Microsoft/msbuild-maintainers ?

@KirillOsenkov

Copy link
Copy Markdown
Member

Could we add this under an escape hatch perhaps? So if someone's build breaks they can turn it back off?

@erikmav

erikmav commented Jan 11, 2018

Copy link
Copy Markdown
Contributor Author

RE: cmd line switch to turn off: Not enough of a perf win to complexify the command line IMO. I'll withdraw the PR.

@erikmav erikmav closed this Jan 11, 2018
@erikmav
erikmav deleted the dev/erikmav/cmdDashD branch January 11, 2018 00:26
@KirillOsenkov

Copy link
Copy Markdown
Member

We have other ways to do escape hatches, namely environment variables. That's what I meant, and not necessarily a command line switch.

@rainersigwald

Copy link
Copy Markdown
Member

https://github.com/dotnet/cli/issues/8331 was root-caused to a user having autoruns and would have been fixed by this, as a data point.

@KirillOsenkov

Copy link
Copy Markdown
Member

Yeah, I didn’t mean to scare this PR away ;)

@erikmav

erikmav commented Jan 20, 2018

Copy link
Copy Markdown
Contributor Author

Easy to bring back, and if there is support overhead from autorun it seems worth it.

@jeffkl

jeffkl commented Jan 22, 2018

Copy link
Copy Markdown
Contributor

@Erikma can you please re-publish your branch? I can then re-open this PR and then I will push a commit that contains the escape hatch.

@erikmav
erikmav restored the dev/erikmav/cmdDashD branch January 22, 2018 19:23
@erikmav erikmav reopened this Jan 22, 2018
@erikmav

erikmav commented Jan 22, 2018

Copy link
Copy Markdown
Contributor Author

Reopened with pushed branch. @jeffkl If we need to restore old logic I need to know which env var you'd like (or push a new commit if you'd like)

@jeffkl

jeffkl commented Jan 22, 2018

Copy link
Copy Markdown
Contributor

I'm almost done. I've added an escape hatch and some unit tests for good measure. I will push after local testing is complete.

@AndyGerlicher

Copy link
Copy Markdown
Contributor

Looks good, except for the compile issue with the test and the conflict :)

@rainersigwald

Copy link
Copy Markdown
Member

@AndyGerlicher So you think we should take this potentially-breaking change?

@jeffkl

jeffkl commented Jan 23, 2018

Copy link
Copy Markdown
Contributor

We'll merge this in master once we've branched for 15.6 so that this won't go out until 15.7 preview 1

@jeffkl
jeffkl merged commit c2f6226 into dotnet:master Jan 23, 2018
@jeffkl

jeffkl commented Jan 23, 2018

Copy link
Copy Markdown
Contributor

Thanks for the contribution @Erikma!

radical pushed a commit to radical/msbuild that referenced this pull request Jan 30, 2018
When spawning Windows cmd.exe shell commands, add the /D parameter to avoid the overhead of checking the autorun configuration in the registry

Also included escape hatch via MSBUILDUSERAUTORUNINCMD environment variable to bring back the functionality.
Jinhuafei pushed a commit to Jinhuafei/msbuild that referenced this pull request Jan 31, 2018
When spawning Windows cmd.exe shell commands, add the /D parameter to avoid the overhead of checking the autorun configuration in the registry

Also included escape hatch via MSBUILDUSERAUTORUNINCMD environment variable to bring back the functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants