Compilation performance comparison of gcc3.4.1 and gcc3.5.0 2004-08-30 on MICO sources
Karel Gardas
kgardas@objectsecurity.com
Thu Sep 2 09:41:00 GMT 2004
Giovanni,
I'm working on submiting bugreports right now, but I have observed one to
me very interesting fact. When I compile files preprocessed by 3.5.0 with
gcc3.4.1 I got slower compile-times, which means regression(s) are not
that dramatic. For example for typecode.cc I got from 40% to 30%. Also for
basic_seq.cc which should regress on all optimization levels, I now got
_no_ regression at all! In fact I got speedups! Look at following table:
Not preprocessed file:
File 341-O0 350-O0 Delta% 341-O1 350-O1 Delta% 341-O2 350-O2 Delta%
basic_seq.cc 3.77 4.21 -10.45 3.98 4.99 -20.24 3.82 5.72 -33.22
File preprocessed by GCC 3.4.1:
File 341-O0 350-O0 Delta% 341-O1 350-O1 Delta% 341-O2 350-O2 Delta%
basic_seq.cc 3.69 3.31 11.48 3.91 3.47 12.68 3.78 3.65 3.56
File preprocessed by GCC 3.5.0:
File 341-O0 350-O0 Delta% 341-O1 350-O1 Delta% 341-O2 350-O2 Delta%
basic_seq.cc 4.61 4.15 11.08 5.28 4.83 9.32 5.62 5.57 0.9
So it seems 3.5.0 is _always_ faster on preprocessed file than 3.4.1! So
either 3.5.0's libstdc++ library is bigger or 3.5.0's cpp is slower.
Size comparison of these two files look:
$ ls -la basic_seq.*.ii
-rw-rw-r-- 1 karel karel 1223628 Sep 2 11:13 basic_seq.341.ii
-rw-rw-r-- 1 karel karel 1243090 Sep 2 11:01 basic_seq.350.ii
I hope you understand that I'm reluctant to submit a regression bugreport
in this case. :-) I have also noted this thing in PR c++/17278 -- which is
for typecode regression...
When I compare table (1) 341-O0 - table (2) 341-O0 == 3.77 - 3.69 == 0.08
seconds spent for 3.4.1's cpp
The same for 3.5.0 is table (1) 350-00 - table (3) 350-O0 == 4.21 - 4.15 == 0.06
seconds, so even 3.5.0's cpp should be a bit faster. So it seems the
culprit should be libstdc++ in 3.5.0, but is it possible that the size
difference of 20kB i.e. 1% difference might do such big difference in
compilation speed?
Thanks,
Karel
On Wed, 1 Sep 2004, Giovanni Bajo wrote:
> Karel Gardas wrote:
>
> > 1) typecode.cc: 40% regression on O1 while 7% speedup on O2
>
> Can you please file a new bugreport with this -O1 regression, attacching this
> preprocessed testcase and the time reports to it? Also link Steven's message in
> it: http://gcc.gnu.org/ml/gcc/2004-08/msg01602.html, which contains the
> analysys of this.
> Then we can set that the new bug blocks PR 13776.
>
> I think it is better to track these issues with different PRs, and just
> connects them to PR 13776 (which is quite confusing at this point) just with
> the Bugzilla relationships.
>
> > -O2: 33% basic_seq.cc and following with 27% static.cc
>
> Can you open also a new bugreport about the regression of basic_seq.cc, which
> regresses at all optimization levels? Again, attacch preprocessed testcases, a
> comparison with 3.4 for all optimization levels, and the relative time reports.
>
> Actually, I should also note that at this point we cannot probably do much
> about compile time regressions at -O1/2/3. GCC 3.5 features more than 60 new
> optimization passes, so it is already a half miracle we don't regress
> everywhere. Code generation is also improved of course, so we have to lose a
> little somwhere. Of course, big regressions (>20% on files of non-trivial size)
> could probably still analyzed a little to see if we find obvious offenders.
>
> Thank you for doing this, it is of great help!
>
> Giovanni Bajo
>
>
>
--
Karel Gardas kgardas@objectsecurity.com
ObjectSecurity Ltd. http://www.objectsecurity.com
More information about the Gcc
mailing list