Skip to content

30 second startup delay on windows #1897

@chtenb

Description

@chtenb

What happened, and what did you expect to happen?

Hi, I'm new to elvish. It looks like a fun crossplatform shell that I'm considering as replacement for nushell. However, I'm having a strange issue.

Elvish.exe suffers from startup delays of about 20-30 seconds on my work windows laptop. I'm not sure why. I don't have any rc.elv.
Usually it happens the first time I start it, then for some time new instances spawn instantly, but then after a minute or so it's slow again.

On WSL this problem does not occur. On my personal windows PC it also does not occur.
It does not matter which terminal emulator I use.
However, it does not seem to be an Anti-Virus issue at first glance, since windows defender does not report any action.
Deploying a windows dev-drive or adding exclusions to the windows virus scanner also does not change the startup delay.
Moreover, elvish -h does not have the delay, so it's really caused by something that is done by elvish.exe.

Daemon Log

[daemon] 2025/04/25 09:52:43 pid is 30160
[daemon] 2025/04/25 09:52:43 going to listen (...)\sock
[store] 2025/04/25 09:52:43 initializing store
[store] 2025/04/25 09:52:43 initialized store

It hangs after this line, but no messages are written after that.

Procmon events in the slow case:

"6:44:42.7799126 PM","elvish.exe","10112","RegQueryValue","HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\Domain","SUCCESS","Type: REG_SZ, Length: 2, Data: "
"6:44:42.7799246 PM","elvish.exe","10112","RegCloseKey","HKLM\System\CurrentControlSet\Services\Tcpip\Parameters","SUCCESS",""
"6:45:04.9706849 PM","elvish.exe","10112","CreateFile","\\AzureAD\PIPE\samr","BAD NETWORK PATH","Desired Access: Generic Read/Write, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a"
"6:45:04.9712146 PM","elvish.exe","10112","RegOpenKey","HKLM\System\CurrentControlSet\Services\Tcpip\Parameters","REPARSE","Desired Access: Read"
"6:45:04.9712476 PM","elvish.exe","10112","RegOpenKey","HKLM\System\CurrentControlSet\Services\Tcpip\Parameters","SUCCESS","Desired Access: Read"

Same chunk in the fast case:

"9:44:08.7834101 AM","elvish.exe","100080","RegQueryValue","HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\Domain","SUCCESS","Type: REG_SZ, Length: 2, Data: "
"9:44:08.7834223 AM","elvish.exe","100080","RegCloseKey","HKLM\System\CurrentControlSet\Services\Tcpip\Parameters","SUCCESS",""
"9:44:08.7835562 AM","elvish.exe","100080","CreateFile","\\AzureAD\PIPE\samr","BAD NETWORK PATH","Desired Access: Generic Read/Write, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a"
"9:44:08.7836671 AM","elvish.exe","100080","RegOpenKey","HKLM\System\CurrentControlSet\Services\Tcpip\Parameters","REPARSE","Desired Access: Read"
"9:44:08.7836763 AM","elvish.exe","100080","RegOpenKey","HKLM\System\CurrentControlSet\Services\Tcpip\Parameters","SUCCESS","Desired Access: Read"

Even though the second case is fast, it could still be the case that it has something to do with the \\AzureAD\PIPE\samr network call.
What could be doing that network call, and can I trouble shoot by tweaking elvish settings?

Hypothesis

To me \\AzureAD\PIPE\samr looks like a windows domain related network lookup, possibly done indirectly to retrieve information about the current user.
I'm not a Go programmer, but I read on the internet that os/user.Current() can possible cause delays.
I found golang/go#68312

Output of "elvish -version"

0.21.0+official

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ❓Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions