Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > optimizing code size

optimizing code size
Thread Tools
Dedicated MacNNer
Join Date: Apr 2004
Status: Offline
Reply With Quote
Sep 3, 2004, 01:34 PM
 
maybe it's just me, but code size on things I've written seems really huge... not in terms of the objective-c code, but the compiled app: for example, the executable for apple's TextEdit is about 112KB here, but apps that I've written that are similar, but do much much less come in around 1MB for the executable size.

What's going on? is apple getting away with more by using carbon? or is it just that they have a couple tricks up their sleeves that they don't want to share?
     
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Sep 3, 2004, 02:40 PM
 
statically linking versus dynamic linking?

poor coding? (no offense, it's a legitimate cause for large executables).
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
Dedicated MacNNer
Join Date: Apr 2004
Status: Offline
Reply With Quote
Sep 3, 2004, 02:49 PM
 
poor coding? nah... see, cause apple includes the source code for text edit in the dev tools (10.2, not Xcode) that I'm using, and compiling it results in a application package aroud 2.2 MB in size (the shipped TextEdit is 684kB or so)

what's the difference between static and dynamic linking? which is better for code size? how do I set things up to use that option?
     
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
Sep 3, 2004, 03:46 PM
 
Originally posted by arcticmac:
poor coding? nah... see, cause apple includes the source code for text edit in the dev tools (10.2, not Xcode) that I'm using, and compiling it results in a application package aroud 2.2 MB in size (the shipped TextEdit is 684kB or so)

what's the difference between static and dynamic linking? which is better for code size? how do I set things up to use that option?
You have debugging code in yours. If your build target a "development build" or a "deployment build."?
     
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
Sep 3, 2004, 04:29 PM
 
yeah, you can either run "strip" on the executable file or set it to deployment mode.
     
Mac Enthusiast
Join Date: Jul 2002
Status: Offline
Reply With Quote
Sep 3, 2004, 04:58 PM
 
You should use Deployment style AND strip.
     
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
Sep 4, 2004, 01:27 AM
 
Originally posted by arekkusu:
You should use Deployment style AND strip.
In XCode doesn't deployment strip the executable? I know there's an option to.
     
Dedicated MacNNer
Join Date: Apr 2004
Status: Offline
Reply With Quote
Sep 4, 2004, 10:22 AM
 
thanks, that's much better... just as a side note though, I couldn't tell that strip made any difference, but having projectbuilder not generate debug symbols and setting it in deploy mode worked great.

thanks again!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:13 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2