Re: fork/exec performance?
Re: fork/exec performance?
- Subject: Re: fork/exec performance?
- From: Jim Magee <email@hidden>
- Date: Mon, 23 Sep 2002 18:06:53 -0400
On Monday, September 23, 2002, at 05:20 PM, Andrew Gallatin wrote:
After writing a software installation script to install a large
software package using libtool, I noticed that the OSX fork/exec
performance seems to be pretty bad.
On the same hardware (dual 800MHz g4), using the same script, the
elapsted time is a hair over 10 seconds on linux (2.4.18-smp). On
OS-X, it is over 3 minutes!
% /usr/bin/time ./GM_INSTALL
<..>
181.25 real 5.58 user 293.31 sys
lmbench shows an order of magnitude difference in fork time,
and nearly as bad in exec:
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.
We have also looked at going straight to posix_spawn(). It avoids the
need to clone the parent process when your real goal was just to exec()
a new process in the first place. But that isn't available now.
--Jim
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.