Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 49995: /trunk/ /trunk/: macosx-setup
From: Guy Harris <[email protected]>
Date: Tue, 18 Jun 2013 10:17:20 -0700
On Jun 18, 2013, at 9:39 AM, Dirk Jagdmann <[email protected]> wrote:

>> Very nice indeed! The only thing that should be done outside the script
>> is setting -j 3: On some systems it is too much, on others it is too
>> little. It should be set in the command line, not the script.
> 
> I could change it to something like:
> 
> if [ -z "$MAKE_BUILD_OPT" ] ; then
>  MAKE_BUILD_OPT="-j 3"
> fi
> 
> This way the user can set custom make options, but the script has a default.

How many processor cores does your machine have, and are they multi-threaded?

I have a 4-dual-threaded-core machine (and a solid-state disk and a lot of memory), and "-j 8" seems to run the CPU at about 100%.  I don't know whether "number of threads" would be a good default in all cases - what you really want is to keep cranking up the number of jobs until things don't get faster, but that's a pain - but, if it is a good default, then
 
	sysctl -n hw.logicalcpu

would give cores*threads-per-core (tested on Snow Leopard, Lion, and Mountain Lion; the script doesn't work on Leopard, as the versions of at least some of the software won't configure and build, and I gave up trying to make them build).

(I originally used -j 4, but then saw something about a multi-threaded version of the IBM System/360 Model 195 that noted that multi-threading can help deal with pipeline bubbles due to unpredicted or mispredicted branches, so I tried -j 8 and found the CPU was busier than with -j 4.)