PDA

View Full Version : Worthless fact of the day



Magos
01-31-2003, 03:31 PM
A "Hello world" program compiled in different compilers:


MS Visual C++ - 225348 bytes
Borland C++ - 75870 bytes
Nasm - 36 bytes

Makes you dizzy, right? :eek: :cool:

-KEN-
01-31-2003, 03:34 PM
Not really....NASM isn't exactly a C/C++ compiler, so it's not exactly comparable...

//edit: And which versions of the two C/C++ compilers? Standard and Enterprise of VC++ would give quite diffferent results with different optimizations on...

//edit2: Also, Debug or Release MSVC++?

Eibro
01-31-2003, 03:36 PM
Sure, on default settings...
Was that debug build by any chance?

-KEN-
01-31-2003, 03:38 PM
MSVC++6 Enterprise, Release, with Optimizations on Minimize Size: 64.0 KB (65,536 bytes)

BMJ
01-31-2003, 03:43 PM
:: Buzzes buzzer ::

This post stinks...

Eibro
01-31-2003, 03:50 PM
Originally posted by BMJ
:: Buzzes buzzer ::

This post stinks...
Oh god, has someone forgotten to change -KEN- again?

-KEN-
01-31-2003, 04:09 PM
::sniffsniff:: - nope, I'm so fresh and so clean...

Travis Dane
01-31-2003, 04:12 PM
Il add one




MS Visual C++ .NET - 462848 bytes
MS Visual C++ 6.0 Enterprise - 225348 bytes
Borland C++ - 75870 bytes
Nasm - 36 bytes

JoeSixpack
01-31-2003, 04:23 PM
MS Visual C++ .NET - 2,048 bytes

It's possible to get lower (at least around 1kb); but I can't be bothered.

Brian
01-31-2003, 05:04 PM
Compiler - Size / bytes

MS Visual C++ .NET - 462848
Mingw - 448537
MS Visual C++ 6.0 Enterprise - 225348
Borland C++ - 75870
Nasm - 36
MS-DOS Debug - 25

MethodMan
01-31-2003, 05:13 PM
Wow, pretty neat.

I dont think the size of the program will really matter until it gets fairly large, or if you have to have it as small as possible for smaller computer devices like watches, robots etc.

damonbrinkley
01-31-2003, 05:42 PM
I know this is comparing apples to oranges but my Python 'Hello World' program is 21 bytes :)

Travis Dane
01-31-2003, 05:57 PM
Reason that .NET is really at it with .EXE size is because if
it's huge framework, It includes alot of things you wouldnt
use anyway. At least that's the case with me, I saw that you
can change that.

Eibro
01-31-2003, 06:24 PM
Originally posted by Travis Dane
Reason that .NET is really at it with .EXE size is because if
it's huge framework, It includes alot of things you wouldnt
use anyway. At least that's the case with me, I saw that you
can change that.
The .NET compiler can compile managed or unmanaged C++ code.

JoeSixpack
01-31-2003, 06:24 PM
>Reason that .NET is really at it with .EXE size is because if
it's huge framework,<

If by this you mean the net framework; then the default size of the actual exe is smaller for the managed code than the unmanaged. So it is not due to this large framework. It is due to the amount of the C runtime library that is linked in with the exe.

Also, it all depends on what enviroment the programs are running in, as the size of the smaller executables running in win32 will have as much meaning as damonbrinkleys python program. The size of the exe/com/whatever will probably pale into insignificance compared with the amount of extra code used by the o/s to carry out the program (either in dlls or because it's using the VDM).

Travis Dane
01-31-2003, 06:35 PM
Originally posted by Eibro
The .NET compiler can compile managed or unmanaged C++ code.

I know that, And thank god.



Also, it all depends on what enviroment the programs are running in, as the size of the smaller executables running in win32 will have as much meaning as damonbrinkleys python program. The size of the exe/com/whatever will probably pale into insignificance compared with the amount of extra code used by the o/s to carry out the program (either in dlls or because it's using the VDM).

Yes, But i'm using the same headers supplied with MSVC++ 6, So
what's with the big file size?

no-one
02-01-2003, 08:37 PM
Codewarrior - 27,136

Travis Dane
02-01-2003, 08:41 PM
QBasic - 18,608 :D

novacain
02-03-2003, 06:52 AM
The libraries that are linked (and the versions linked to ie debug is bigger)

My non MFC app written in MSVC v6 in C for WIN32 is 400K release and 1200K debug.

It is around 40,000 lines of code (not counting libraries and standard headers). It is a sort of a fully featured browser (just for a special site).