5 ms·
And where is the copy-on-write happening here? If I recall correctly, the problem was that attempting to reproduce fork()'s copy-on-write behavior on Windows re
by wfunction 11y ago
And where is the copy-on-write happening here? If I recall correctly, the problem was that attempting to reproduce fork()'s copy-on-write behavior on Windows resulted in a massive performance hit. (Which, IIRC, contributes to the slowness of Cygwin.)
EDIT: Oh, I'd skipped the part above "here's how it works"... that just says exactly the same thing I said above.
- TickleSteve 11y agoI've personally never had any real performance issues with Cygwin. What are you doing that involves lots of forking? For me, Cygwin has always been pretty much native-speed, its only an API translation layer.
- wfunction 11y ago> What are you doing that involves lots of forking? Running scripts? Also, try enumerating the files in a large directory hierarchy and compare it with native Windows speed (or Linux speed), it's not even comparable.
- TickleSteve 11y agofair enough, it probably wont match native for that. Personally tho, speed has always been sufficient for me to never notice. I use it most days, but I don't do comparisons.
- wfunction 11y ago"Won't match native" is quite the understatement. It's not a question of a 40% speed difference, more like a > 400% speed difference last time I checked.
- gnoway 11y agoI use Cygwin as my terminal environment for everything that works. Any fs operation involving lots of files (e.g. find) is slow. Copying files is slow. CIFS in particular seems much slower via //server/share in Cygwin than native \\server\share. One way to really see the latter is to try to create a git clone using the --reference option against a repo on a mapped drive; msysgit using the drive letter is OK, but cygwin git against the same repo via /cygdrive/mapped is very slow. Edit: by 'everything that works' I mean everything that interacts with the terminal in a standard way. There are some command line utilities which output to the terminal some way other than stdout, making them very difficult to use in cygwin.
- nanny 11y agoI have few "real" performance issues with Cygwin as well. However, when I perform the same tasks in gnu/linux there is a noticeable speed increase. So what I mean to say is that Cygwin's performance isn't necessarily bad, it's just not as good as the real thing.
- novocaine 11y agoGNU make. Keep in mind that in addition to the build steps, it's common to break out to sed, grep, and shell to get basic string operations done due to extremely limited capability of make itself. On cygwin, this is slow for large projects. Cygwin's forking is also temperamental. https://cygwin.com/cygwin-ug-net/highlights.html#ov-hi-process https://cygwin.com/cygwin-ug-net/highlights.html#ov-hi-proce... "In summary, current Windows implementations make it impossible to implement a perfectly reliable fork, and occasional fork failures are inevitable." I wonder how the authors of midipix propose to resolve the listed issues.
- deleted 11y ago[deleted]
- poizan42 11y agoIt is possibly to fork on Windows by using ZwCreateProcess directly, however the win32 subsystem and every single thirdparty library you are using does not expect this. If you are only using the NT native api then it should work just fine, but you are prevented from interacting with the win32 environment.
- wfunction 11y ago> if you are only using the NT native API then it should work just fine I believe I had trouble executing any instructions in the new process at all. If you can make it work I'd like to see your code, otherwise I'm skeptical.
- poizan42 11y agoAFAIK this is how fork() is implemented in SUA, but I haven't tried it myself. You could load the SUA subsystem dll into IDA Pro and see how they actually do it.
- wfunction 11y agoI believe the POSIX subsystem has some kind of support from the native API that prevents you from writing your own random subsystem and expecting it to work; I don't remember what it was though (it's been a few years).
- poizan42 11y agoThere's some special handling when loading the image where it does different things depending on the value of the subsystem field, but I don't know whether there's any special handling in the kernel that can't be duplicated by using the native api. But the NT kernel does very little when it comes to initializing new processes, most of the initialization is done in user space by ntdll, so it seems unlikely. Anyways the cygwin guys claim to have forked processes with ZwCreateProcess, but just had problems with getting it to work with the win32 subsystem: http://www.cygwin.com/ml/cygwin-developers/2011-04/msg00034.html http://www.cygwin.com/ml/cygwin-developers/2011-04/msg00034.... Also this guy seems to have managed to do it: http://stackoverflow.com/questions/10657699/cant-use-createprocess-in-child-process-using-simulating-fork-code-on-windows-7 http://stackoverflow.com/questions/10657699/cant-use-createp..., but it hang when he called a win32 function (CreateProcess) from the child.