Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* interesting observations...
@ 1999-01-11  1:33 Designer 7
  1999-01-11  5:40 ` Cameron Simpson
  0 siblings, 1 reply; 2+ messages in thread
From: Designer 7 @ 1999-01-11  1:33 UTC (permalink / raw)
  To: axp-list

I just recompiled egcs-1.1.1-release with a previous egcs-1.1.1-release 
that I compiled with egcs-1.0.3b. Here is an interesting observation:

egcs-1.1.1 g++ compiled with egcs-1.1.1

-rwxr-xr-x   1 root     root       118668 Jan 10 07:37 g++*

egcs-1.1.1 g++ compiled with egcs-1.0.3b

-rwxr-xr-x   1 root     root       248948 Dec 14 01:34 g++*

Note the huge difference in size.. what's going on?

Both were compiled with the same flags except I changed -O2 to -O3 and 
added -finline-functions during the second time around with egcs-1.1.1. 
I would expect these flags to make the output larger... but now it's 
less than half!

odd.....

D

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: interesting observations...
  1999-01-11  1:33 interesting observations Designer 7
@ 1999-01-11  5:40 ` Cameron Simpson
  0 siblings, 0 replies; 2+ messages in thread
From: Cameron Simpson @ 1999-01-11  5:40 UTC (permalink / raw)
  To: axp-list

On 11 Jan 1999, in message <19990111013358.26681.qmail@hotmail.com>
  "Designer 7" <designer_7@hotmail.com> wrote:
| I just recompiled egcs-1.1.1-release with a previous egcs-1.1.1-release 
| that I compiled with egcs-1.0.3b. Here is an interesting observation:
| 
| egcs-1.1.1 g++ compiled with egcs-1.1.1
| -rwxr-xr-x   1 root     root       118668 Jan 10 07:37 g++*
| 
| egcs-1.1.1 g++ compiled with egcs-1.0.3b
| -rwxr-xr-x   1 root     root       248948 Dec 14 01:34 g++*
| 
| Note the huge difference in size.. what's going on?
| 
| Both were compiled with the same flags except I changed -O2 to -O3 and 
| added -finline-functions during the second time around with egcs-1.1.1. 
| I would expect these flags to make the output larger... but now it's 
| less than half!

Hmm. What does the size(1) command say about those executbles?
(My first suspect is symbol tables, but parhaps the code really is
smaller...)

As regards size, heavier optionisation could readily produce smaller
code, and inlining functions strips all that function call stuff, which
could easily be a very big gain on small functions where trivial (or at
least fairly simple) operations have been abstracted into functions for
various reasons.

Consider the gains of inlining this:

	void incref(int *refp)
	{ *refp++;
	}

in code which makes lots of reference counter updates. The optimizer
could fold it down to a single instruction (or even optimise it out
completely for transient changes i.e. "incref(&p.cnt); blah blah blah
decref(&p.cnt)") whereas without inlining there's a whoel function call
setup, call, op-via-pointers, return. Potentially a large gain.

So, what's size(1) say about these images?
--
Cameron Simpson, DoD#743        cs@zip.com.au        http://www.zip.com.au/~cs/

Loose lids kink squids.	- Jody.P.Levine@hydro.on.ca DoD#275


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-01-11  6:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-01-11  1:33 interesting observations Designer 7
1999-01-11  5:40 ` Cameron Simpson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox