Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 65174 - PyQt takes ages to compile and produces high load
Summary: PyQt takes ages to compile and produces high load
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-24 02:02 UTC by Dirk Heinrichs
Modified: 2004-12-19 13:22 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Heinrichs 2004-09-24 02:02:16 UTC
When I emerge PyQt, compiling the first file:

g++ -c -pipe -march=pentium3 -O2 -pipe -fomit-frame-pointer -fPIC -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I. -I/usr/include/python2.3 -I/usr/qt/3/include -I/usr/X11R6/include -o sipqtpart0.o sipqtpart0.cpp

takes a very long time (more than 15 minutes) on a 500MHz PIII machine and produces a high load of more than 12.

This is caused by the "-c" flag used when calling configure.py in the ebuild. From the PyQt FAQ:

"Why does compilation take so long?


 PyQt is big, and comprises many source files. However, the configure.py script takes a -c command line flag which concatenates each module's C++ source files into one large file. If your compiler and system are capable of compiling large C++ source files then compilation times can be reduced dramatically. Using this flag PyQt will compile in 10 minutes on a Linux based 750MHz 256M PIII system."

Please don't do this. make it at least a USE flag. I'd also guess that compiling multiple small files instead of a large one would be better with regard to distcc.

Reproducible: Always
Steps to Reproduce:
1.emerge PyQt

Actual Results:  
Load increases above 12, system isn't really useable any more. 

Expected Results:  
Load shouldn't increase to that degree, system should remain useable, as it is 
w/o the -c option.
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2004-09-24 10:48:08 UTC
The concatenation of the c++ files speeds up compilation for the majority of systems. Compiling the whole PyQt takes 

real    8m57.063s
user    6m19.340s
sys     0m47.470s

on my 1.2Ghz Duron (and this is a slow machine nowadays), compared to

real    88m6.551s
user    71m48.460s
sys     4m52.640s


when having concatenation disabled. Also the load wasn't lower in the latter case (rather a bit higher, but I used the system while testing). Did you made such a comparison on your machine (ccache disabled)? I really dislike adding new use flags, if there's not a very good reason for this. Switching concatenation of when distcc is in Features would be possible, but I would like to see some numbers, which justify this.


>Load increases above 12, system isn't really useable any more. 

That's not a good reason. You can always (re-)nice single processes and we've the PORTAGE_NICENESS variable for this.
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2004-09-24 17:06:59 UTC
Um, the 8 minutes were _cached_ of course, but uncached it's still below 30 minutes
Comment 3 Brian Friday 2004-10-02 13:03:45 UTC
I'm not sure I care about the taking forever (it is qt afterall...) and I can't replicate the high load (1.2 load average during compile). 

BUT it would be real nice for sanity's sake to insert a "We are compiling now you just may not see anything for the next few (seconds, minutes, hours etc) after this message:

>>> md5 src_uri ;-) PyQt-x11-gpl-3.12.tar.gz
>>> Unpacking source...
>>> Unpacking PyQt-x11-gpl-3.12.tar.gz to /var/tmp/portage/PyQt-3.12/work
>>> Source unpacked.


My reasoning is I just tried recompiling this but I thought I had hung in a real weird way since I didn't get *ANY* output.
Comment 4 Dirk Heinrichs 2004-10-06 01:20:22 UTC
Of course I did renice the cc1plus process to the lowest priority possible, but that didn't help. And, if you don't want to introduce a new USE flag, that's ok for me, but an ebuild _should_ IMHO prefer stability over speed. I can reproduce this behaviour on this type of machine and the fix is to avoid concatenation.
Comment 5 Csaba Tóth 2004-10-21 04:02:28 UTC
i am still in this situation, my computer hangs for about 4 hours (!) when i try to copile the kdebindings (and it was ended in a bug...) i was so happy...
my computer is a 2,8 GHz P4M (acer travelmate 634LC).
every time if i compile a kde app, or part of the kde, my computer hangs a lot of time. (hang = the mouse not moving, the keyboard not working - i cant change to the second console (alt+control+f2), the clock on the right on the kde panel dont change, it seems like a hardware crash, but the winchester led is blinking)
Comment 6 Olivier Migeot 2004-11-20 06:49:03 UTC
Another problem is that the compilation of PyQt takes a lot of memory. On a medium-end system (I got 256Mb RAM, minus 64 eaten by the videocard), the whole RAM and swap are eaten, and the process is killed by kernel. This is quite troublesome, so it would be nice if the flag could be deactivated.
Comment 7 Carsten Lohrke (RETIRED) gentoo-dev 2004-12-19 13:22:32 UTC
>but an ebuild _should_ IMHO prefer stability over speed.

Dirk, the stability issue is on your side. I tried a couple of configurations and not even with ~90 MB left for compilation (+300 MB swap) I could reproduce your problems. Also one usually compiles on another box, if the target is that antiquated. 

T
Comment 8 Carsten Lohrke (RETIRED) gentoo-dev 2004-12-19 13:22:32 UTC
>but an ebuild _should_ IMHO prefer stability over speed.

Dirk, the stability issue is on your side. I tried a couple of configurations and not even with ~90 MB left for compilation (+300 MB swap) I could reproduce your problems. Also one usually compiles on another box, if the target is that antiquated. 

Tóth: KDE needs a lot of ressources for compilation and of course it swaps a lot without enough ram. 4 hours or more for the whole kdebindings package sounds reasonable for your box.

>On a medium-end system
Oliver - that's low end. Who still sells a box with 256MB ram only is simply an asshole. I changed the latest PyQt ebuild. Do 'FEATURES=distcc emerge PyQt' and you're rid of the flag.