binary size 
Author Message
 binary size

I broke a 1400 line .c file into three files. Two .c files and one .h
file. I then re-complied the program. The binary sizes are:

One .c file : 120K
Two .c files and one .h file: 90K

I'm not using shared libraries or any thing like that so i would expect
the file sizes to be close than this 25% decrease in size...Any reason
in particular for this??

--
original guitar music at
http://www.*-*-*.com/



Sat, 10 Jan 2004 00:51:50 GMT  
 binary size

Quote:

>I broke a 1400 line .c file into three files. Two .c files and one .h
>file. I then re-complied the program. The binary sizes are:

>One .c file : 120K
>Two .c files and one .h file: 90K

>I'm not using shared libraries or any thing like that so i would expect
>the file sizes to be close than this 25% decrease in size...Any reason
>in particular for this??

Just speculating, the compiler can do more inter-procedural optimizations
when everything is in one file.  Many inter-procedural optimizations
increase executable size, e.g. inlining, loop unrolling and other
code-improving transformations that duplicate basic blocks.  Without a large
inter-procedural context within which to perform these transformations,
the compiler is unable to waste a lot of space on them.
--

"I've so much music in my head" -- Maurice Ravel, shortly before his death.
"                             " -- John Cage


Sat, 10 Jan 2004 01:07:30 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. binary size diff' & compilers

2. Re-compiling code on a new server generates different binary sizes?

3. Proposal: alt.binaries.examples.vb4 , alt.binaries.examples.vcpp , alt.binaries.examples.java

4. binary file and different size of structures

5. Help getting size of binary file for allocating pointer array

6. Add binary and Substract binary

7. reading a binary file back to binary

8. Getting a larger binary from a binary ?

9. how can search binary code in binary file?

10. Hex to Binary => Binary to Hex

11. HELP: Binary Large Objects (need to store binary file w/in database)

12. microsoft binary to ieee binary format

 

 
Powered by phpBB® Forum Software