RE: [Dev-C++] GCC 3.2 (MinGW 2.0) Compiled File Sizes
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <iv...@em...> - 2003-07-12 19:37:44
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Marc Heiligers
> Sent: Saturday, July 12, 2003 8:04 PM
> To: Dev-Cpp User's List
> Subject: [Dev-C++] GCC 3.2 (MinGW 2.0) Compiled File Sizes
>=20
>=20
> I just wrote a command line program that does a little string=20
> manipulation
> and spits out (read as cout << (std::string)) a modified=20
> string (using the
> command line parameters as input). The complete source is=20
> less 100 lines of
> code and resides in a single file. I make use of the=20
> <iostream> and <string>
> headers. I compiled and found it worked perfectly, but the=20
> executable was
> 468KB in size! I was expecting something more along the lines=20
> of 10KB. So I
> tried the following little program:
>=20
> #include <iostream>
> #include <string>
>=20
> int main(int argc, char *argv[])
> {
> std::string s =3D "Hello, World";
> std::cout << s;
> return 0;
> }
>=20
> This simple "Hello, World" demo compiles to 442KB (using=20
> default compiler
> settings, no optimization, no exception handling - and 156KB=20
> using the old
> Dev-Cpp default compiler). This is a little extreme, don't you think?
Yes, g++ has been entirely rewritten and produces more bloated code... I
guess mainly because they use bloated header files (their system =
extensions
must be collected to few header files).
>=20
> So does anyone know of a way to reduce the file sizes=20
> generated by GCC 3.2?
Only the optimisation switches.
> The only thing that springs to mind is that the template=20
> class handling of
> GCC is not that great. If we try the same demo using C-code=20
> (compiled as
> C++):
>=20
> #include <stdio.h>
>=20
> int main(int argc, char *argv[])
> {
> char* s =3D "Hello, World";
> printf("%s", s);
> return 0;
> }
>=20
> we get a program that compiles to 21KB (and 9KB using the old Default
> Dev-Cpp compiler - even this shows a large increase in size=20
> using GCC 3.2)!=20
I think we can be sure that as time passes things will get improving. =
That's
all. :-)
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
|