Worthless fact of the day

This is a discussion on Worthless fact of the day within the A Brief History of Cprogramming.com forums, part of the Community Boards category; A "Hello world" program compiled in different compilers: Code: MS Visual C++ - 225348 bytes Borland C++ - 75870 bytes ...

  1. #1
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Worthless fact of the day

    A "Hello world" program compiled in different compilers:
    Code:
    MS Visual C++ - 225348 bytes
    Borland C++   - 75870 bytes
    Nasm          - 36 bytes
    Makes you dizzy, right?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  2. #2
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    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++?
    Last edited by -KEN-; 01-31-2003 at 03:36 PM.

  3. #3
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Sure, on default settings...
    Was that debug build by any chance?

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    MSVC++6 Enterprise, Release, with Optimizations on Minimize Size: 64.0 KB (65,536 bytes)

  5. #5
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    :: Buzzes buzzer ::

    This post stinks...

  6. #6
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Originally posted by BMJ
    :: Buzzes buzzer ::

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

  7. #7
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    ::sniffsniff:: - nope, I'm so fresh and so clean...

  8. #8
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Il add one

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

  9. #9
    Registered User
    Join Date
    Sep 2002
    Posts
    272
    MS Visual C++ .NET - 2,048 bytes

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

  10. #10
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    Code:
    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

  11. #11
    Microsoft. Who? MethodMan's Avatar
    Join Date
    Mar 2002
    Posts
    1,198
    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.
    -MethodMan-

    Your Move:Life is a game, Play it; Life is a challenge, Meet it; Life is an opportunity, capture it.

    Homepage: http://www.freewebs.com/andy_moog/home.html

  12. #12
    Registered User
    Join Date
    Oct 2002
    Posts
    385
    I know this is comparing apples to oranges but my Python 'Hello World' program is 21 bytes
    Wandering aimlessly through C.....

    http://dbrink.phpwebhosting.com

  13. #13
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    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.

  14. #14
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    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.

  15. #15
    Registered User
    Join Date
    Sep 2002
    Posts
    272
    >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).
    Joe

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ( posts per day)
    By dwks in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 06-05-2008, 01:53 AM
  2. day number in yaer
    By azsquall in forum C++ Programming
    Replies: 6
    Last Post: 05-24-2008, 03:44 AM
  3. Printing weekday
    By sworc66 in forum C Programming
    Replies: 12
    Last Post: 09-13-2002, 08:03 AM
  4. one fine day...
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 44
    Last Post: 11-15-2001, 06:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21