Thread: Re: RES: [Dev-C++] generated .exe is too big
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <dem...@uw...> - 2003-04-22 20:45:16
|
That would be the upgrade to gcc3.2, not Dev-C++'s settings. There've been a lot of questions like this. You can switch back to gcc2.95 manually if you want to, just uninstall Dev-c++, download the gcc2.95 package from mingw, download standalone Dev-C++ and set it up yourself. I personally prefer gcc3.2 though. At 12:06 PM 22/04/2003 -0400, David Matthews wrote: >> > I have the problem that the generated exe is too big with the version >> > 4.9.8.0. The same code compiled with Dev-C++ 4.01 is 5 KB, but with >> > 4.9.8.0 about 35 KB. Debug information is switched off, so I don't know >> > what the problem is. >> >> Dev-C++ does not compile anything; if 35 KB is a big problem to you, you >> should ask on MinGW's mailing list (probably somewhere at www.mingw.org). > >Hi! > >I forgot to write that I have had this problem since I upgraded Dev-C++, >so in my opinion it's a problem with the default settings, not with the >compiler. I thought of the debugging info, but it's switched off, so I >don't know what else to change. Is there anyone who had the same problem? > > Thanks, > > Laszlo > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |
|
From: michel.weinachter <mic...@fr...> - 2003-04-23 19:32:53
|
hello, Did you try the -Os option ? (O for optimisation, s for small) The default option (-O0 ) includes a lot of debuging information. bye |
|
From: Louis G. <lg...@ya...> - 2003-04-23 15:17:04
|
David and List, It seems unbelievable that the same code compiled with gcc 2.95 generates a 5kb exe file, compared to 35kb when compiled under gcc3.2. A 100% increase would be bad enough; but this is a 700% increase ?? Can other DevC++ users comment on this ? --- David Matthews <dem...@uw...> wrote: > That would be the upgrade to gcc3.2, not Dev-C++'s settings. There've > been > a lot of questions like this. You can switch back to gcc2.95 manually > if > you want to, just uninstall Dev-c++, download the gcc2.95 package from > mingw, download standalone Dev-C++ and set it up yourself. I personally > prefer gcc3.2 though. > > At 12:06 PM 22/04/2003 -0400, David Matthews wrote: > >> > I have the problem that the generated exe is too big with the > version > >> > 4.9.8.0. The same code compiled with Dev-C++ 4.01 is 5 KB, but > with > >> > 4.9.8.0 about 35 KB. Debug information is switched off, so I > don't know > >> > what the problem is. > >> > >> Dev-C++ does not compile anything; if 35 KB is a big problem to you, > you > >> should ask on MinGW's mailing list (probably somewhere at > www.mingw.org). > > > >Hi! > > > >I forgot to write that I have had this problem since I upgraded > Dev-C++, > >so in my opinion it's a problem with the default settings, not with the > >compiler. I thought of the debugging info, but it's switched off, so I > >don't know what else to change. Is there anyone who had the same > problem? > > > > Thanks, > > > > Laszlo > > > > > > > >------------------------------------------------------- > >This sf.net email is sponsored by:ThinkGeek > >Welcome to geek heaven. > >http://thinkgeek.com/sf > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com |
|
From: Szathmary L. <sz...@de...> - 2003-04-23 22:13:31
|
> David and List,
> It seems unbelievable that the same code compiled with gcc 2.95
> generates a 5kb exe file, compared to 35kb when compiled under
> gcc3.2. A 100% increase would be bad enough; but this is a 700%
> increase ??
>
> Can other DevC++ users comment on this ?
Hi,
Last time I wrote the sizes by heart, but now I tried it again:
The example code is:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
printf("Hello World!\n");
system("PAUSE");
return 0;
}
With Dev-C++ 4.01 it is 4608 bytes; with Dev-C++ 4.9.8.0 it is 22619
bytes. Compiler options are the same in both cases (any optimization and
debugging information are switched off).
I tried it with a more complicated console application too: 10240 bytes
vs. 35973 bytes :(
I tried the -Os option too, but it only reduced 1 KB.
Thanks,
Laszlo
|
|
From: Daniel K. O. <dan...@ya...> - 2003-04-23 22:41:51
|
> With Dev-C++ 4.01 it is 4608 bytes; with Dev-C++ 4.9.8.0 it is 22619 > bytes. Compiler options are the same in both cases (any > optimization and > debugging information are switched off). > I tried it with a more complicated console application too: 10240 bytes > vs. 35973 bytes :( > I tried the -Os option too, but it only reduced 1 KB. What about some benchmarks between the different versions of MinGW? Which one is faster? Did anyone did it already? Daniel K. O. |
|
From: Per W. <pw...@ia...> - 2003-04-23 22:14:24
|
See partial answer that I wrongfully managed to send to Samuel Keding - I missed that he had changed thread name... /Per W On Wed, 23 Apr 2003, Louis Godio wrote: > David and List, > It seems unbelievable that the same code compiled with gcc 2.95 > generates a 5kb exe file, compared to 35kb when compiled under > gcc3.2. A 100% increase would be bad enough; but this is a 700% > increase ?? > > Can other DevC++ users comment on this ? > > --- David Matthews <dem...@uw...> wrote: > > That would be the upgrade to gcc3.2, not Dev-C++'s settings. There've > > been > > a lot of questions like this. You can switch back to gcc2.95 manually > > if > > you want to, just uninstall Dev-c++, download the gcc2.95 package from > > mingw, download standalone Dev-C++ and set it up yourself. I personally > > prefer gcc3.2 though. > > > > At 12:06 PM 22/04/2003 -0400, David Matthews wrote: > > >> > I have the problem that the generated exe is too big with the > > version > > >> > 4.9.8.0. The same code compiled with Dev-C++ 4.01 is 5 KB, but > > with > > >> > 4.9.8.0 about 35 KB. Debug information is switched off, so I > > don't know > > >> > what the problem is. > > >> > > >> Dev-C++ does not compile anything; if 35 KB is a big problem to you, > > you > > >> should ask on MinGW's mailing list (probably somewhere at > > www.mingw.org). > > > > > >Hi! > > > > > >I forgot to write that I have had this problem since I upgraded > > Dev-C++, > > >so in my opinion it's a problem with the default settings, not with the > > >compiler. I thought of the debugging info, but it's switched off, so I > > >don't know what else to change. Is there anyone who had the same > > problem? > > > > > > Thanks, > > > > > > Laszlo > > > > > > > > > > > >------------------------------------------------------- > > >This sf.net email is sponsored by:ThinkGeek > > >Welcome to geek heaven. > > >http://thinkgeek.com/sf > > >_______________________________________________ > > >Dev-cpp-users mailing list > > >Dev...@li... > > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > __________________________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo > http://search.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Ioannis V. <iv...@at...> - 2003-04-24 01:13:44
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Louis Godio > Sent: Wednesday, April 23, 2003 6:17 PM > To: David Matthews; dev...@li... > Subject: Re: RES: [Dev-C++] generated .exe is too big >=20 >=20 > David and List, > It seems unbelievable that the same code compiled with gcc 2.95=20 > generates a 5kb exe file, compared to 35kb when compiled under > gcc3.2. A 100% increase would be bad enough; but this is a 700% > increase ?? >=20 > Can other DevC++ users comment on this ? My assumption is the new C99 built in types and library facilities are = what caused that increase (the default is C99 now!). That implies that you = get the built in _Bool with values 0 or 1, built in _Complex type, long = long, etc. C no more maps directly in the machine (C++ still does). That is = CPUs do not have complex types. All these types with the _ can be used without _ in the normal way e.g. complex y; by including the corresponding header file (e.g. #include <complex.h>). What I personally would have liked is that they could have made = available these "exotic" types (because they are not made using general purpose facilities), as typedefs through the header files only. Well, as Dennis Ritchie told, there will not be any new K&R. C++98 provides specialised facilities made using general purpose = facilities. Some references: http://www.itworld.com/AppDev/710/lw-02-stroustrup/page_1.html http://www.itworld.com/Comp/3380/lw-12-ritchie/page_1.html Check what they say about C99. 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 Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Per W. <pw...@ia...> - 2003-04-24 02:27:06
|
The changes for C99 should not make a real difference in quality of mapping against hardware. _Bool should map perfectly - no difference than the bool type in C++. long long might be either multiple assembler instructions or calls to helper functions, but no difference from the normal long type on a 8 or 16-bit processor. The linker need not add these extra helper functions unless they are called in the compiler-emitted object files. _Complex operators needs either multiple assembler instructions or calls to helper functions, to handle all combinations of NaN and infinities. No difference from support of float and double on a processor without fp support. Linker wouldn't add these helper functions unless needed. It isn't possible to add _Bool and _Complex as just typedef, since it's a question of giving the language the correct operators too. In C++ with operator overloading we can add a _Complex type on our own, but in C it has to be made as a hard-coded data type. /Per W On Thu, 24 Apr 2003, Ioannis Vranos wrote: > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of Louis Godio > > Sent: Wednesday, April 23, 2003 6:17 PM > > To: David Matthews; dev...@li... > > Subject: Re: RES: [Dev-C++] generated .exe is too big > > > > > > David and List, > > It seems unbelievable that the same code compiled with gcc 2.95 > > generates a 5kb exe file, compared to 35kb when compiled under > > gcc3.2. A 100% increase would be bad enough; but this is a 700% > > increase ?? > > > > Can other DevC++ users comment on this ? > > My assumption is the new C99 built in types and library facilities are what > caused that increase (the default is C99 now!). That implies that you get > the built in _Bool with values 0 or 1, built in _Complex type, long long, > etc. C no more maps directly in the machine (C++ still does). That is CPUs > do not have complex types. > > All these types with the _ can be used without _ in the normal way e.g. > complex y; by including the corresponding header file (e.g. #include > <complex.h>). > > > What I personally would have liked is that they could have made available > these "exotic" types (because they are not made using general purpose > facilities), as typedefs through the header files only. > > > Well, as Dennis Ritchie told, there will not be any new K&R. > > > C++98 provides specialised facilities made using general purpose facilities. > > > Some references: > > http://www.itworld.com/AppDev/710/lw-02-stroustrup/page_1.html > > http://www.itworld.com/Comp/3380/lw-12-ritchie/page_1.html > > > Check what they say about C99. > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Ioannis V. <iv...@at...> - 2003-04-24 02:57:22
|
> -----Original Message----- > From: Per Westermark [mailto:pw...@ia...] > Sent: Thursday, April 24, 2003 5:26 AM > To: Ioannis Vranos > Cc: Dev-C++ Mailing List > Subject: RE: RES: [Dev-C++] generated .exe is too big > > > The changes for C99 should not make a real difference in quality of > mapping against hardware. > > [...] > > _Complex operators needs either multiple assembler > instructions or calls > to helper functions, to handle all combinations of NaN and > infinities. No > difference from support of float and double on a processor without fp > support. Linker wouldn't add these helper functions unless needed. Yes but there are processors with fp support. However there isn't any with complex support. > It isn't possible to add _Bool and _Complex as just typedef, > since it's a > question of giving the language the correct operators too. In C++ with > operator overloading we can add a _Complex type on our own, > but in C it > has to be made as a hard-coded data type. I mean they could avoid polluting the namespace. And what about size_t? In C99 it can be some type other than the provided standard built in ones, and yet is provided through header file only. In any case, these things do increase the size of the final executable. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Per W. <pw...@ia...> - 2003-04-24 03:12:35
|
_Bool does not increase size of final executable. _Complex and (possibly) long long increases the size of the executable - but only for executables that needs them, and then it can hardly count. An opengl executable is larger than a hello world, but that isn't a deficiency of opengl but just that the opengl application solves a harder problem. Without the _Complex data type, you have to implement - or link through an existing library - your own complex math. And by doing that, the application has to be larger or the application wouldn't work. If you don't use _Complex but decides on defining an own data type and then implement complex_add(), complex_mul(), ... the application will not make any references to the _Complex helper functions and won't link in them. No extra size of the executable added, at least for non-debug where the compiler haven't thrown in a lot of data declarations seen in header files etc just for good measure. The only complaint I think I have about _Complex - too long time ago I looked at the specification - was that some of the NaN/Infinity handling didn't felt mathematically sound. But that is a completely different issue. /Per W On Thu, 24 Apr 2003, Ioannis Vranos wrote: > > -----Original Message----- > > From: Per Westermark [mailto:pw...@ia...] > > Sent: Thursday, April 24, 2003 5:26 AM > > To: Ioannis Vranos > > Cc: Dev-C++ Mailing List > > Subject: RE: RES: [Dev-C++] generated .exe is too big > > > > > > The changes for C99 should not make a real difference in quality of > > mapping against hardware. > > > > [...] > > > > _Complex operators needs either multiple assembler > > instructions or calls > > to helper functions, to handle all combinations of NaN and > > infinities. No > > difference from support of float and double on a processor without fp > > support. Linker wouldn't add these helper functions unless needed. > > > Yes but there are processors with fp support. However there isn't any with > complex support. > > > > > It isn't possible to add _Bool and _Complex as just typedef, > > since it's a > > question of giving the language the correct operators too. In C++ with > > operator overloading we can add a _Complex type on our own, > > but in C it > > has to be made as a hard-coded data type. > > > > I mean they could avoid polluting the namespace. And what about size_t? In > C99 it can be some type other than the provided standard built in ones, and > yet is provided through header file only. > > In any case, these things do increase the size of the final executable. > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Ioannis V. <iv...@at...> - 2003-04-24 04:03:14
|
> -----Original Message----- > From: Per Westermark [mailto:pw...@ia...] > Sent: Thursday, April 24, 2003 6:11 AM > To: Ioannis Vranos > Cc: Dev-C++ Mailing List > Subject: RE: RES: [Dev-C++] generated .exe is too big > > > _Bool does not increase size of final executable. > > _Complex and (possibly) long long increases the size of the > executable - > but only for executables that needs them, and then it can > hardly count. An > opengl executable is larger than a hello world, but that isn't a > deficiency of opengl but just that the opengl application > solves a harder > problem. > > Without the _Complex data type, you have to implement - or > link through an > existing library - your own complex math. And by doing that, the > application has to be larger or the application wouldn't work. > >[...] I did not say that complex type existence is bad (although I do not like to provide whatever type one can imagine as built in). I posted my theory why the C99-compliant MINGW 3.x produce larger executables than 2.95.x ones. I think it is because of the the new built in types and library facilities (for example printf() got larger to support the new types and changes). Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Per W. <pw...@ia...> - 2003-04-24 03:33:14
|
Forgot a comment. See below /Per W On Thu, 24 Apr 2003, Ioannis Vranos wrote: > > -----Original Message----- > > From: Per Westermark [mailto:pw...@ia...] > > Sent: Thursday, April 24, 2003 5:26 AM > > To: Ioannis Vranos > > Cc: Dev-C++ Mailing List > > Subject: RE: RES: [Dev-C++] generated .exe is too big > > > > > > The changes for C99 should not make a real difference in quality of > > mapping against hardware. > > > > [...] > > > > _Complex operators needs either multiple assembler > > instructions or calls > > to helper functions, to handle all combinations of NaN and > > infinities. No > > difference from support of float and double on a processor without fp > > support. Linker wouldn't add these helper functions unless needed. > > > Yes but there are processors with fp support. However there isn't any with > complex support. > General purpose processors have a bit of lack of this support, but a number of DSP processors do have built-in data types for complex numbers since they are used in FFT evaluations etc. In this case, the _Complex data type makes C code more portable. Previous implementations has had to add non-standard additions for handling this data type. In the same way, a number of processors have 1-bit variables. When programming the 8051 processor, one compiler I have been using have added the extra keyword bit just to allow the use of these variables. Now it gets defined in the base language, allowing easy portability to other C vendors having a compiler for that processor. It should be noted that while C++ is more used on PC-class hardware and upwards, C is very large in the embedded market, and the guys implementing these compilers have a tough time constantly adding extra data types and keywords just because the NEED to map the full capability set of the used processor. In desktop programming, we don't give a damn if the compiler ignores using one or two exotic processor instructions but in the embedded market that instruction might be the difference between a working and a non-working application, and no designer designs in +10 - +50% higher chips multiplied by 100k units to get an extra feature and not being able to use it. With _Bool and _Complex data types, they might test-run the application on their normal PC while developing, and then recompile the source with the target compiler and make timing and final test runs on the real metal. > > > > It isn't possible to add _Bool and _Complex as just typedef, > > since it's a > > question of giving the language the correct operators too. In C++ with > > operator overloading we can add a _Complex type on our own, > > but in C it > > has to be made as a hard-coded data type. > > > > I mean they could avoid polluting the namespace. And what about size_t? In > C99 it can be some type other than the provided standard built in ones, and > yet is provided through header file only. > > In any case, these things do increase the size of the final executable. > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |