Commit 4c8b9ee
Nathan Baird
Eliminate conhost.exe from git.exe and hooks process launches
GVFS launches git.exe processes with CreateNoWindow=true (or CREATE_NO_WINDOW
in native code). Despite the name, this flag tells Windows to create a NEW
hidden console for the child process, which allocates a conhost.exe instance.
For frequent, small git operations (e.g. during prefetch), the per-process
conhost creation/teardown overhead is disproportionately large.
Fix: Set CreateNoWindow=false in GitProcess.cs. With UseShellExecute=false
and stdout/stderr redirected to pipes, the child process inherits the parent's
console state. Since GVFS.Mount runs as a service with no console, the child
gets no console and no conhost.
ProcessHelper.cs is left unchanged — it is used by gvfs.hooks.exe and gvfs.exe
(CLI) which run with a console, where the existing behavior is appropriate.
For native code (GitHooksLoader.cpp), replace CREATE_NO_WINDOW with
DETACHED_PROCESS, which truly detaches from any console without allocating
a new one.
Reference: ToolLocationTransformer PR 15071136 (same pattern)
Linked: ADO #623852821 parent 1e748bb commit 4c8b9ee
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
| 827 | + | |
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
0 commit comments