[Qt-creator] parallel processing in make
Carter, Nathan
NCARTER at bentley.edu
Fri Jul 16 14:49:01 CEST 2010
On Jul 15, 2010, at 9:49 PM, Coda Highland wrote:
> I can't imagine why Creator couldn't guess at a default value anyway;
> just ask QThreadPool what the ideal number of threads is. :P
Actually, if Creator can do it with QThreadPool, why can't qmake do it with QThreadPool? Then my Makefile would always have the right -j argument for the machine it was created on.
On Jul 16, 2010, at 6:29 AM, Danny Price wrote:
> I used to do that but the setting is lost when the pro.user file is regenerated. Is there a way to set this in the .pro file?
Yes, but even better, let's have it as the default behavior for qmake to choose a -j N argument for make, but you can override it if you'd rather not use all cores or something like that.
> Doesn't make automatically use all available cores if the 'j' argument is not set? I'm sure I read that somewhere.
No, here's what I just tried on my 4-core system with one small/medium-sized Qt project:
make clean ; time make
Time: 1m10s
Activity monitor showed:
Two cores nearly unused the whole time
Other two partially used the whole time (up+down)
make clean ; time make -j 2
Time: 42s
Activity monitor showed:
Two cores only slightly (30%?) used the whole time
Other two maxed out the whole time
make clean ; time make -j 4
Time: 34s
Activity monitor showed:
All four cores maxed out the whole time
So make does not guess correctly from the point of view of "please finish as fast as possible."
Nathan
More information about the Qt-creator-old
mailing list