We are running a Windows .EXE file via a Cygwin script and are encountering performance issues. I have seen various posts about Cygwin performance issues, including this one, one of whose answers delves enough into Cygwin internals to make me think there could be a problem. However, these posts do seem to be more about startup time, tab completion, etc. Before we launch on a benchmarking witch hunt, I was hoping to ask: is there any intrinsic reason why a Windows .EXE could run slower if kicked off from Cygwin vs. BAT?
Asked
Active
Viewed 690 times
5
-
1If you are seeing high CPU load, that might indicate a runaway thread, which could conceivably be caused by a bug in your program in combination with some difference in the way Cygwin launches it. – Harry Johnston Dec 14 '16 at 00:30
1 Answers
3
Not the actual program, no.
Housekeeping and stuff before running the program may vary. Cmd probably calls CreateProcess
directly. Cygwin's bash may first do argument parsing, wildcard expansion, fork via Cygwin's slow implementation and call exec
with the parsed arguments, which Cygwin has to piece together into a string again to pass to CreateProcess
. But in the end, a new process is created which has no ties to its parent anymore. So how fast your program runs entirely depends on that program, not on who launched it.

Joey
- 344,408
- 85
- 689
- 683
-
There's no difference, e.g., in the way the standard handles are set up? – Harry Johnston Dec 12 '16 at 21:56
-
1@HarryJohnston: I wouldn't know that, but that would only affect input and output via them, not the speed at which the program runs, wouldn't it? – Joey Dec 13 '16 at 10:03
-
1Typically, yes, but a sufficiently buggy program might behave differently depending on the standard handles. It wouldn't be my first or even my second guess, but I wouldn't rule it out entirely. :-) – Harry Johnston Dec 14 '16 at 00:28
-
2@HarryJohnston: Well, there's always situations like [these](http://stackoverflow.com/q/21947452/73070) ;-). – Joey Dec 14 '16 at 07:09