Monday, June 20, 2005

Application sizes: CW vs Xcode

So, this weekend I built my small application with both Xcode and CodeWarrior, looking to quantify the differences in the executable sizes. I found that after deployment, the Xcode executable was 808KB, while the CodeWarrior one was only 364KB (60% smaller). So I went looking in the files too see where the differences were. If the differences are inn the code generation, and Xcode applications are in general 120% bigger than CodeWarrior ones, then that's a serious problem. On the other hand, if the differences are all overhead, and don't change as the applications get bigger, then that's much less of a problem (although still a PITA)

Ok. Here's what I've found out so far:
The __TEXT segment of the Xcode executable is much larger than the CW one (557K vs. 212K). Most of this extra stuff is in two sections that don't exist in the CW executable "__textcoal_nt" (256K) and "__eh_frame" (136K).

Also, the __LINKEDIT section of the Xcode executable is much larger than the CW one (243K vs 124K).

Together, these three chunks alone make the Xcode executable half a megabyte (512K) bigger than the CW one. Without those, the sizes are quite comparable (the Xcode one would even be smaller).

Now, to figure out what those sections are for!

2 Comments:

At 11:31 PM, Blogger Stefan Werner said...

The additional size might be additional symbols. As far as I know, gcc exports all the symbols of an executable, where CodeWarrior lets you explicitly specify which ones to export and which not.

 
At 9:51 AM, Blogger Marshall Clow said...

Nope, that's not it.

It's an application. It exports one symbol: __start.

/usr/bin/strip was run as part of the deployment process, so that all the internal symbol names should be gone, too.

 

Post a Comment

<< Home