Re: fork/exec performance?
On Mon, 23 Sep 2002 18:06:53 -0400 Jim Magee <jmagee@apple.com> wrote: vfork() yields 100X (yes, 100 times, not percent more) the performance of fork() in most situations on Mac OS X. So, if you can live with vfork() requirements, please do so. Getting common tools to use it where appropriate appears to be the trick in your case. I don't think Linux has vfork(), so people tend to stick with just fork() in portable code. Is there any chance of improving fork+exec performance in the OS since, as you say, many programs currently use fork? (Just for fun I did a quick and dirty change to bash to make it use vfork+_exit, which included moving the fork up one stack frame and some other small changes, to see if I could improve automake, (gnu-)libtool and friends' performance (they currently run really slow on mac os x, it is sad when the compile time is just a fraction of the time spent to build things.) The program seems to work for simple interactive use, but crashes immediately on shellscripts, I haven't checked what the problem is yet. Anyway, as far as I can tell, with my very limited knowledge on both vfork world limitations and the bash code, it could possibly be pretty hairy to (correctly) change for example bash to use vfork instead of fork, it would be nice if there was a smaller performance hit. If anyone more knowledgeable would take on the bash-vfork task instead I for one would be most grateful. Maybe if I filed a radar... :-) /ragge _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Ragnar Sundblad