I did a full install of Cygwin on my Windows 7 x64 machine. After each machine reboot, Curl can take around 6 seconds to start (even if no command line options were specified). On subsequent uses of Curl there is no delay. It looks like a DLL is being initialized or ? Has anyone else seen that and is this normal?
-
1Could be the Cygwin DLL initializing itself, if no Cygwin processes have been previously started. How are you invoking curl -- from the Windows shell, or from Cygwin bash? Do you have any Cygwin services enabled, or any Cygwin commands that run on startup or login? – Aaron Miller Aug 12 '13 at 16:12
-
I am invoking it from the Windows cmd prompt (not from bash). I haven't configured any other services to start. I have reproduced the problem on other machines including 32 bit Windows XP so I am thinking it might be the normal time to startup but I want to confirm this. – user265445 Aug 12 '13 at 17:38
1 Answers
This is normal; the first time the Cygwin DLL runs, it performs several initialization steps, which can potentially be time-consuming, to set up the Cygwin environment. This initialization occurs the first time after system boot that a Cygwin process is created, and there is unfortunately no real way around it.
The best recommendation I can offer is to modify your system startup scheme, or your login scripts, to create a Cygwin process, so that the initialization time gets "rolled in" at a point when you're already expecting to be waiting on the system, rather than occurring later on when you're expecting a quick response. For example, you might add something like the following, as a batch file, to C:\Users\<your username>\AppData\Local\Microsoft\Windows\Start Menu\Programs\Startup:
c:\cygwin\bin\run.exe '/bin/bash -c "ls > /dev/null"'
This will launch a Cygwin bash process which fairly quickly does nothing and then exits, without displaying a window on your console -- thus forcing the Cygwin DLL to load and initialize itself, without producing any side effects, and so that when you finally open a command prompt and run curl, the initialization time will have already occurred, and you won't be annoyed by it while running interactive commands.
- 9,782
- 24
- 39