Repository navigation
Replies: 2 comments
|
Update — root cause found, plus a correction to what the 240–255 ms figure measured. The 240–255 ms in my first reply was one The variable turns out to be the directory:
Same binary, same command, same restriction level. Spawning it from Python costs 200–300 ms from either location, so it is the DSH spawn path plus that directory. The tree is 292 MB across 934 files (781 DLLs). The plausible mechanism is the extra restricting-SID pass over Moving the tree to So there are two separate costs, and they need separate fixes: the shell wrapper (fixed by not using it when the command is already an argv) and the binary's location (fixed by moving it out of |
|
Adding the evidence behind the location finding, and what the remaining 900 ms is made of. The ACL difference between the two directories. Every file under The copy under Where the 900 ms goes now. With the binary outside
The sandbox share is measured directly: Still unexplained. The ~1.3 s kernel wait from the original report. The minidump landed on |
Uh oh!
There was an error while loading. Please reload this page.
TL;DR — On 0.2.1-rc.3 / Windows 10, a tool call that goes through the pwsh wrapper costs 4.2–4.7 s of wall time while a call that spawns another program directly costs 0.46–0.67 s.
pwsh.exestarts in 0.2 s on its own, andpowershell.exe5.1 goes through the same sandboxed spawn path in 0.6 s. Seven causes are ruled out below; the wait sits inside process creation and onlypwsh.exepays it.Environment — DSH desktop 0.2.1-rc.3 (built 2026-10-23), Windows 10.0.19045, PowerShell 7.5.8,
workspace-writesandbox. A local plugin replacesPwshLocalExecutor.prototype.argvwith a direct split when the command is only "absolute path + arguments"; everything else keeps the stockpwsh -NoLogo -NoProfile -NonInteractive -Command "<cmd>". Numbers below aretool/call→tool/resultfrom the session log.The split
exitGet-ChildItem,Get-Content,$var = …(5 calls)node.exe -e "…"powershell.exe -NoProfile -Command "…"python.exe <script>(7 calls)Where the 4.2 s sits. A command whose only job is to print a timestamp printed
15:43:42.237. The tool call started at15:43:37.986and its result landed at15:43:42.302. So 4,251 ms elapsed before the script ran its first statement, and 65 ms after its last one. It is not the command, not the output, and not the teardown.Ruled out
pwsh -NoProfile -Command exitoutside DSH: 202 ms median-NoProfilesaves 8 ms (190 vs 198)-Commandpreamblepowershell.exe5.1 runs under the same Low-integrity token in 596 msreadcosts 84 ms end to end, the hook script 40–73 msThe token is confirmed Low:
whoami /groupsreportsMandatory Label\Low Mandatory Level, and CIM is unavailable inside it, matching the documented Authenticated-Users removal.Still unexplained — Inside an already-confined
pwsh, spawning anotherpwshtakes 194–207 ms. Letting DSH spawnpwshcosts 4,239 ms. A minidump taken during the wait on 0.2.1-rc.2 had RIP atZwCreateUserProcess+0x14, called fromCreateProcessInternalW: the thread is waiting inside process creation, not computing.So the question is what makes process creation take 4 s for
pwsh.exespecifically, on a spawn path that builds the same restricted token and Job fornode.exeandpowershell.exein 0.4–0.6 s. Has anyone instrumentedlaunchWindowsJob, or is there a supported way to see where the per-spawn token and Job setup spends its time?All reactions