No wonder all MS programs are HUGE.

Zorba

Lifer
Oct 22, 1999
15,613
11,256
136
I just wrote a ~100 line program (Source is about 2K (including a my personal header file). I compiled this program first with Mingw, and it was a total of 3.8KB. I then tried it with MS VC++ 4.0 and it came out 110KB (along with 500KB of crap files). After seeing this I decided to compile it with MS VC++ 6.0, the program came to a grand total of 180KB (along with 800KB of other files).

This made me wonder, so I recompiled a file that I wrote in VC++ 4.0 about a year ago. This program has ~1200 lines (give or take 100). With VC++ 4.0 it was 200KB (I didn't think that was to bad at the time). After my last test I decided to try this on the other two. VC++ 6.0's version was a HUGE 350KB. Mingw's version, though, was only 21KB!!!

Conclusion: All MS programs will be HUGE until they learn how to write a good compiler. What sucks in all of this, is I like VC++ 4.0's Editor the best, but I will not be able to stand knowing my files could be 10% the size using Mingw with Dev-C++.

 

JellyBaby

Diamond Member
Apr 21, 2000
9,159
1
81
Yep, it's pretty shocking actually. Back in the early 80's my Timex Sinclair 1000 had 2K memory. It had several impressive games including a decent flight simulator. All coded within 2K! Now you declare any variable and you consume at least that. Pretty nuts, eh?
 

BFG10K

Lifer
Aug 14, 2000
22,709
3,004
126
MS Visual C++ is probably the best x86/Windows compiler in existance. Most commercial programmers use it (Carmack did Q3 with it) and it is also a really good IDE.

As for your problems:

Optimise your code for size, not for speed (compilation options). Speed optimisations make the program bigger.

Avoid including libraries and other people's code if you can accomplish the same thing with just a few small lines of your own code.
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
Alot of people seem to think that C++ Builder is better than VC++ these days.
 

It's the Windows mentality that let this thing get out of hand. As soon as it became acceptable to ship 100M word processors it was all over. I am amazed at the stuff people are doing on the Palm platform. Programs that would be HUGE under Windows are only a few kilobytes on the Palm platform. Now that's coding for ya.
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
Are you compiling with debugging enabled? That massively increases the size of the finished product.

My latest program that I've been tinkering with, has about 3000 lines, and has a moderately sophisticated GUI and file structure. VC++ 6.0 results in an 80 kB executable - admittedly still bloated, but acceptable.

The debug executable on the other hand is close to 300 kB.
 

HigherGround

Golden Member
Jan 9, 2000
1,827
0
0
your are either ...
(a) compiling in DEBUG mode
(b) including static libraries wich you don't need, such as MFC *.lib files.
 

Rigoletto

Banned
Aug 6, 2000
1,207
0
0
Flight simulator in 2k?? Don't believe it was more than arcade stuff. Did this machine have rubber keys or a touch pad? (spectrum/ zx80/1)
 

Zorba

Lifer
Oct 22, 1999
15,613
11,256
136
I might be compiling in DEBUG mode, hadn't thought of that. If it is the default then I am.