From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 27778 invoked from network); 11 Jan 1999 06:12:24 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 11 Jan 1999 06:12:24 -0000 Received: from kwanon.research.canon.com.au (kwanon.research.canon.com.au [203.12.172.254]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id AAA07530 for ; Mon, 11 Jan 1999 00:51:07 -0500 Received: (qmail 15766 invoked from network); 11 Jan 1999 05:46:15 -0000 Received: from grainger.research.canon.com.au (203.12.174.130) by kwanon-heat.research.canon.com.au with SMTP; 11 Jan 1999 05:46:14 -0000 Received: (qmail 1949 invoked from network); 11 Jan 1999 06:07:01 -0000 Received: from byron.research.canon.com.au (203.12.174.223) by grainger.research.canon.com.au with SMTP; 11 Jan 1999 06:07:01 -0000 Received: (from cameron@localhost) by byron.research.canon.com.au (8.8.5/8.8.5) id QAA00223 for axp-list@redhat.com; Mon, 11 Jan 1999 16:48:14 +1100 (EST) X-mailer: m, by Cameron Simpson Date: Mon, 11 Jan 1999 05:40:57 +0000 Subject: Re: interesting observations... References: <19990111013358.26681.qmail@hotmail.com> From: Cameron Simpson Reply-to: cs@zip.com.au Errors-to: cs@zip.com.au Organization: Canon Information Systems Research Australia, Sydney, Oz Message-id: <19990111164813-cameron-1-00149@byron.research.canon.com.au> To: axp-list@redhat.com On 11 Jan 1999, in message <19990111013358.26681.qmail@hotmail.com> "Designer 7" 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