|
From: Wu Y. <ad...@ne...> - 2003-12-08 03:32:17
|
I just cannot understand why you think 47% code size difference is "huge". Different compilers will certainly give different results based on its code generation method, optimization used, and library implentation. I'll give you a feel using the C++ HelloWorld (using std::iostream): MSVC 6: 65536 MSVC 6 dynamic linkage: 16384 MSVC 6 dynamic linkage with "/link /opt:nowin98": 3584 MSVC 6 w/ STLport 4.5: 212992 MSVC 6 w/ STLport 4.5 dynamic: 16384 Borland C++ Compiler 5.5.1: 113152 DigitalMars Compiler 8.37 w/ STLport 4.5.3: 361500 GCC 2.95.3-8: 75776 GCC 2.95.3-8 w/ STLport 4.5.3: 338432 GCC 2.95.3-8 w/ STLport 4.5.3 dynamic: 29696 GCC 3.3.1: 217600 If you call 147% a "huge" value, how will you call 10095% (361500/3584)? :-) Best regards. Wu Yongwei --- Original Message from Don Ho --- Is there a remedy for that? 160 KB (497 KB vs 340 KB) is really huge! Don HO Je bouffe donc je suis |
|
From: Wu Y. <ad...@ne...> - 2003-12-09 03:12:37
|
>>> WHO CARES? >> >> Certainly, not my customers. >> > > Then, just go on. Give them a 40MB executable, with 1GIG memory > requirements. Why stop at just 2MB? 150% is one thing, 2000% is another: they are completely different scales. IMHO, the GCC guys want first to produce a standards-compliant compiler, and to do the optimizations later. Indeed I do not like GCC 3 very much because of exactly the same reason as yours. However, probably they are still on the right track. >>> Nobody. This increases consumption (I need 512MB RAM), and >>> reduces mental effort of the developers. Who needs anything else? >>> >> >> The cost of 512 MB RAM amounts for a few hours work of a poorly >> paid programmer in Europe. No much more time on most countries. >> > > No, because my motherboard will not go beyond some gigs. > >>> Why care if the application takes 4MB or 2MB? >> >> Who cares if the cost of the application is 10,000 euro or 30,000 >> euro? >> > > Are you saying that a more efficient compiler would increase the cost > of the application? > > A bug is a bug, even if you say it doesn't matter. I suppose that Oscar wanted to say that the customer cares more about the development cost than the memory cost. That's the main point. Of course, the number of users will count. If thousands of users or more are expected, spending time on the size may be worthwhile. Now for some technical stuff. Is your application C++ or C? Does it use heavily STL? STL is known to bloat software, esp. in some implementations. It really seems that the Dinkum STL (which MSVC uses) is less efficient but more memory compact. Libstdc++-v3 and STLport is memory-consuming, and SGI STL used in GCC 2.95.3 stands in the middle for memory usage but less standards-compliant (yes, SGI STL is my favourite). And you cannot scale the 497 KB vs 340 KB size up as 5MB vs 3MB, since the static part won't change. I.e. for a application of 10MB, the difference could be well below 1MB (10%). Bottom line: If you develop a small application, using only C (or, using C++ without iostreams/templates/exceptions) can reduce the size. If you develop a big application, using the advanced C++ features can win you time that you cannot possibly save from the size reduction (the ratio will be much lower). You can never expect to find the terrible 10000% size difference that I posted in a medium-sized application. Best regards, Wu Yongwei |
|
From: jacob n. <ja...@ja...> - 2003-12-09 19:03:47
|
I downloaded and installed gcc (mingw) There seems to be no problem at all with the code size for straight C. Compiling the IDE of lcc-win32 gives: MSVC 827 443 bytes gcc 773 632 bytes lcc 684 576 bytes All compilers are generating with optimization for code size ON. Compile time: MSVC 20 seconds gcc 52 seconds lcc 6 seconds The speed of the generated code is impossible to measure in an interactive program. Gcc should be slightly faster than lcc though. The problem we see is surely due to C++. No compiler in the world (besides the EDG front end and maybe Comeau C++) compiles the full standard. Gcc is approaching slowly but there is no point in trying to optimize anything right now. C++ requires a LOT of man-power for building a compiler. More probably that gcc can master. jacob |
|
From: Wu Y. <ad...@ne...> - 2003-12-09 04:45:25
|
Although GCC is my primary compiler, I never think GCC is superior to Visual C++. I love it because it is cross-platform and free. MSVC 6 is not as good as GCC, in that it has poor template support and is not standards-compliant, but it is a very old product. And I have hardly seen GCC win on pure C code for efficiency and code compactness, let alone C/C++ compilation speed, when compared with MSVC The real advantage of GCC is that it is the de facto standard for cross-platform development, and it conforms to the standards quite well. And its code performance is among the best (but I am sure it is not THE best). If your code uses STL, then the size difference can be quite easily attributed to libstdc++-v3. You can see the HelloWorld example show already a size difference of 148.5KB. Best regards, Wu Yongwei --- Original Message from Don HO --- I've never tried to compile the HelloWorld prog to compare among the different versions. That's the 1st time that I build the same project with different compilers. Since I always think GCC is superior to VC++, I was shocked by the fact. That's why I think this amount (160 KB almost, but not 60 KB event 100KB) is huge. Don HO Je bouffe donc je suis |
|
From: Don H. <do...@al...> - 2003-12-09 00:52:02
|
I've never tried to compile the HelloWorld prog to compare among the different versions. That's the 1st time that I build the same project with different compilers. Since I always think GCC is superior to VC++, I was shocked by the fact. That's why I think this amount (160 KB almost, but not 60 KB event 100KB) is huge. Don HO Je bouffe donc je suis Find a powerful free (and open source) multi-function editor at http://notepad-plus.sourceforge.net/ ----- Original Message ----- From: "Wu Yongwei" <ad...@ne...> To: <min...@li...> Sent: Monday, December 08, 2003 4:29 AM Subject: Re: [Mingw-users] Generated Binary is BIGGER than VC++ 7 generated binary !!! > I just cannot understand why you think 47% code size difference is > "huge". Different compilers will certainly give different results based > on its code generation method, optimization used, and library > implentation. I'll give you a feel using the C++ HelloWorld (using > std::iostream): > > MSVC 6: 65536 > MSVC 6 dynamic linkage: 16384 > MSVC 6 dynamic linkage with "/link /opt:nowin98": 3584 > MSVC 6 w/ STLport 4.5: 212992 > MSVC 6 w/ STLport 4.5 dynamic: 16384 > Borland C++ Compiler 5.5.1: 113152 > DigitalMars Compiler 8.37 w/ STLport 4.5.3: 361500 > GCC 2.95.3-8: 75776 > GCC 2.95.3-8 w/ STLport 4.5.3: 338432 > GCC 2.95.3-8 w/ STLport 4.5.3 dynamic: 29696 > GCC 3.3.1: 217600 > > If you call 147% a "huge" value, how will you call 10095% (361500/3584)? :-) > > Best regards. > > Wu Yongwei > > --- Original Message from Don Ho --- > > Is there a remedy for that? > 160 KB (497 KB vs 340 KB) is really huge! > > > Don HO > Je bouffe donc je suis > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users |