🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49927

Re: Help needed reducing size of g++ .o files

#49927
From: Joe Buck
Date: Tue, 07 Dec 1993 18:31
24 lines
1779 bytes
maverick@halcyon.com (Thomas M. J. Fruchterman) writes:
>  I have been developing a large class library in g++. I am finding that 
>code files (*.o) for deeply nested classes are growing very large even
>though I am only overriding one or two methods in the derived class.
>  Devived classes are on the order of 10 levels deep 
>  single inheritance only
>  approximately 100 -200 methods in the virtual function table
>  total instance data approximately 100 bytes
>  size of .o file without debugging code - approximately 50K. 
>
>  I need to reduce that 50k number to something reasonable. Does anyone
>have experience with what causes this bloat and how to deal with it

Use #pragma interface and #pragma implementation.  See the gcc
manual for details.  Right now, you're probably getting many copies
of virtual function tables and "inlined" functions that can't be
inlined (if you don't say -O, then no "inlined" functions are inlined).
The pragmas cause only one copy to be generated.


-- 
-- Joe Buck	jbuck@synopsys.com
Posting from but not speaking for Synopsys, Inc.
Formerly jbuck@<various-hosts>.eecs.berkeley.edu
Technical Details
Message-ID: <1993Dec7.183131.4713@Synopsys.Com>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!chronos.synopsys.com!news.synopsys.com!jbuck
References: <2e03d8$r4e@nwfocus.wa.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,442311dacc2c59d2
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-12-08 04:21:02 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!chronos.synopsys.com!news.synopsys.com!jbuck
From: jbuck@synopsys.com (Joe Buck)
Subject: Re: Help needed reducing size of g++ .o files
Message-ID: <1993Dec7.183131.4713@Synopsys.Com>
Keywords: n
Sender: usenet@Synopsys.Com
Organization: Synopsys, Inc.
References: <2e03d8$r4e@nwfocus.wa.com>
Date: Tue, 7 Dec 1993 18:31:31 GMT
Lines: 24