Hi,

I just stumbled over the impression, that doing multi-process builds (e.g. -P2), at least when hot, need significantly more time than single-process builds.

E.g. building the Writer, in case nothing actually needs to be build, gives something as:

 [EMAIL PROTECTED] sw> time build.pl -P2
 ....
 Multiprocessing build is finished
 Maximal number of processes run: 2
 2.884u 0.972s 0:36.42 10.5%     0+0k 0+0io 2pf+0w

 [EMAIL PROTECTED] sw> time build.pl
 ...
 2.956u 0.828s 0:04.02 93.7%     0+0k 0+0io 0pf+0w

That means, build.pl needs 36s if it has been called with -P2 and 4s if called plain. Looking at the output while building gives the impression, that there are some sleeps when waiting for forked processes to return. Taking a look at build.pl I can find several "sleep 1" instructions. Commenting out line number 1435:
#        sleep 1 if (children_number() >= $QuantityToBuild);
gives:

 sw> time build.pl -P2
 ...
 Multiprocessing build is finished
 Maximal number of processes run: 2
 4.564u 1.088s 0:06.60 85.4%     0+0k 0+0io 0pf+0w

which is near to the single process case.

I think I understand the purpose of the "sleep 1", actually to wait for forked processes to terminate, though I think that a "sleep" is not the best solution and I would vote for something like a "waitpid" or similar.

Regards

  Kay

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to