File size difference under different compilers.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chen Shusheng

    #1

    File size difference under different compilers.

    Hello,
    I do a experiment on compile one file using different compilers.I got the
    results below:
    Output file1: hello1 14,332Byte under C-free
    Output file2: hello2 4,096Byte under Dev-C++
    Output file3: hello3 57,344Byte under Microsoft Visual C++ Express
    2005
    Why does these files vary so large?
    Is there any method and tools of analyzing these .EXE files to see its
    difference?
    CSS


  • Jim Langston

    #2
    Re: File size difference under different compilers.

    "Chen Shusheng" <lyrachina@hotm ail.tomwrote in message
    news:QlvGg.3953 2$%f4.276782@wa gner.videotron. net...
    Hello,
    I do a experiment on compile one file using different compilers.I got the
    results below:
    Output file1: hello1 14,332Byte under C-free
    Output file2: hello2 4,096Byte under Dev-C++
    Output file3: hello3 57,344Byte under Microsoft Visual C++ Express
    2005
    Why does these files vary so large?
    Is there any method and tools of analyzing these .EXE files to see its
    difference?
    CSS
    What compiler switches did you use? Were they all in debug or release?
    Etc... There are quite a bit of factors that can effect an executable size,
    and all compilers are not created equal.

    Reguardless, I would say on the MS VC++ Express you compiled in debug mode,
    which adds code, and a few other settings that can bloat code.


    Comment

    • Ian Collins

      #3
      Re: File size difference under different compilers.

      Chen Shusheng wrote:
      Hello,
      I do a experiment on compile one file using different compilers.I got the
      results below:
      Output file1: hello1 14,332Byte under C-free
      Output file2: hello2 4,096Byte under Dev-C++
      Output file3: hello3 57,344Byte under Microsoft Visual C++ Express
      2005
      Why does these files vary so large?
      Is there any method and tools of analyzing these .EXE files to see its
      difference?
      Why do you care?

      The difference may appear large with a single file, but end up being
      insignificant on a real application.

      --
      Ian Collins.

      Comment

      • Ron Natalie

        #4
        Re: File size difference under different compilers.

        Chen Shusheng wrote:
        Hello,
        I do a experiment on compile one file using different compilers.I got the
        results below:
        Output file1: hello1 14,332Byte under C-free
        Output file2: hello2 4,096Byte under Dev-C++
        Output file3: hello3 57,344Byte under Microsoft Visual C++ Express
        2005
        Why does these files vary so large?
        Is there any method and tools of analyzing these .EXE files to see its
        difference?
        CSS
        >
        >
        In the two large cases you most likely are getting static linked
        copies of the RunTime libraries (i.e., the entire startup, memory
        allocation, io system, everything that is referred to in your
        program). For the smallest one, you are most likely using dynamic
        runtimes (DLL's for the case of Windows, shared libraries for
        UNIX). The program size is just about the same, except that
        the code lives in other modules than your exe.

        Comment

        Working...