From kde-core-devel Fri May 17 15:40:26 2002 From: Rolf Magnus Date: Fri, 17 May 2002 15:40:26 +0000 To: kde-core-devel Subject: GCC 3.1 - even slower compilation and relocation X-MARC-Message: https://marc.info/?l=kde-core-devel&m=102166265006814 Hi, =46irst of all: if you aren't interested in some comparisons between gcc 2.= 95.3=20 and gcc 3.1, just stop here. This is not about the speed of the generated=20 executables (it's about app startup time though) I did some testing of the newly released GCC 3.1. I was using some CVS=20 versions before and found some speed penalties in compilation, relocation a= nd=20 a massive increase in size of debugging binaries. Now I got the new gcc 3.1 to try out if it has become better in the release= =2E=20 =46irst, I did a complete build (not only symlinks src tools) of the curren= t=20 qt-copy, once with gcc 2.95.3 and once with gcc 3.1 (CPU is Athlon XP at=20 1.533Ghz). Compile time: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (configure options for qt were -qt-gif -system-zlib -qt-imgfmt-mng=20 =2Dsystem-libpng -qt-imgfmt-jpeg -system-libjpeg -no-g++-exceptions -thread= =20 =2Dno-xinerama -xft -debug) output of "time make" with gcc 2.95.3: real 34m56.576s user 33m16.010s sys 1m12.750s and with gcc 3.1: real 69m10.886s user 65m58.620s sys 1m49.540s So compilation with gcc 3.1 takes twice! as much time as with 2.95.3. Someo= ne=20 mentioned that I should have compiled gcc 3.1 with --disable-checking to=20 reduce some runtime checking overhead, but it didn't give much improvement: real 66m59.415s user 63m15.600s sys 1m45.950s Relocation times: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This is the result of "LD_DEBUG=3Dstatistics designer" gcc 2.95.3: 19610: runtime linker statistics: 19610: total startup time in dynamic loader: 99450870 clock cycles 19610: time needed for relocation: 96252974 clock cycles (96.7= %) 19610: number of relocations: 11570 19610: number of relocations from cache: 19609 19610: time needed to load objects: 2912251 clock cycles (2.9%) gcc 3.1: 19605: runtime linker statistics: 19605: total startup time in dynamic loader: 155168071 clock cycles 19605: time needed for relocation: 150826130 clock cycles (97.= 2%) 19605: number of relocations: 13878 19605: number of relocations from cache: 21553 19605: time needed to load objects: 4010301 clock cycles (2.5%) So the relocation time goes up by a factor of about 1.5 with gcc 3.1. Those= =20 are the results of a qt linked with the new binutils 2.12 -z combreloc opti= on=20 that speeds up relocations. I have some older results with gcc HEAD of=20 2002-03-21, where the -z combreloc results were about the same. Just in cas= e=20 you are interested in the effect that -z combreloc has on the relocation=20 time, those are the results without it: gcc 2.95.3: 07188: 07188: runtime linker statistics: 07188: total startup time in dynamic loader: 144293736 clock cycles 07188: time needed for relocation: 124828263 clock cycles (86.= 5%) 07188: number of relocations: 18640 07188: number of relocations from cache: 19802 07188: time needed to load objects: 5526436 clock cycles (3.8%) gcc HEAD as of 2002-03-21: 10263: 10263: runtime linker statistics: 10263: total startup time in dynamic loader: 208165944 clock cycles 10263: time needed for relocation: 204587996 clock cycles (98.= 2%) 10263: number of relocations: 40241 10263: number of relocations from cache: 2434 10263: time needed to load objects: 3252161 clock cycles (1.5%) Debug builds: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Debug binaries don't grow as much as with the CVS version I tested, but sti= ll=20 they get twice as big with 3.1 (with the CVS version, it was a factor of 3): debugging version of qt compiled with 2.95.3: =2Drwxr-xr-x 1 root root 28M May 17 11:27 libqt-mt.so.3.0.4 and with 3.1: =2Drwxr-xr-x 1 root root 54M May 17 01:05 libqt-mt.so.3.0.4 Non-debug builds seem to be comparable in size though. Conlcusion: gcc 3.1 is slow, even much slower than 2.95.3 :(, and app start= up=20 times will go up again. And if you have a small disk, forget about debug=20 builds with gcc 3.1