Skip to main content
gamedev.net
🔒 Locked

Execution File Size

Started by Tradone Apr 24, 2006 at 7:25 PM 7 replies 1.7k views
Original Post
Tradone
Tradone
My Execution Code File Size is growing out of control. It's 4 Mbytes already, with O0 compression, and 1.5Mbytes with O2
LessBread
LessBread
Is that release mode?
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
AAAP
AAAP
Huey, nice 8)

and I doubt that its stripped of debug info and such... are you by any chance using gcc?
|aaap.penopticon.com| My website, including game projects. Collaboration/comments are welcome, please visit :)
Tradone
Tradone
I'm not familiar with release mode ( and have no idea even after a google search) , my programming platform is freeBSD. Language is C++, and compiler is gcc to be more specific.

for example, I added about 5 lines and the code went up by 200k, LOL
and i didn't even use a new library.
AAAP
AAAP
well with visual C++ it's easy to choose release mode and have all debug info stripped from executable, resulting in much smaller file. I'm not exactly sure of the parameters in GCC, but I don't believe it has to do with compression, thats more of an optomization thing. If you're using Dev-C++, you can go into

project options -> compiler -> linker

and set Strip Executable to yes (it seems to be "No" by default), I would bet that would solve your problem. I don't know the actual gcc command line switch for this however.
|aaap.penopticon.com| My website, including game projects. Collaboration/comments are welcome, please visit :)
JohnBolton
JohnBolton
Compression? The 'O' option controls optimization, not compression. "-O0" means no optimization and the code is usually pretty large. It is normally used only for debugging.

Performance-wise, "-O3" is the best optimization level, but the code might be bigger than "-O2". If you are concerned about the size of the executable more than its performance, then "-Os" is the one you want. It will try to generate the smallest executable at the expense of performance.

There are also linker options to strip unused code and data.

Why are you concerned about the size of the executable?
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Tradone
Tradone
I'm not so concerned, but just don't want my files to get any larger. IDK. So, even though the file size is big, it doesn't necessarily mean that it will run slower right?
Emmanuel Deloget
Emmanuel Deloget
Quote:
Original post by Tradone
I'm not so concerned, but just don't want my files to get any larger. IDK. So, even though the file size is big, it doesn't necessarily mean that it will run slower right?


True and false at the same time. In theory, it should not change anything - and most of the time, it won't shnage anything. THere might be a problem when code locality comes into play, because having the processor flushing its code cache migh take time - and if he does this too often (by jumping all around), the performance may decrease.

Remeber that using templates might make your program size grow (as well as using global variables BTW) but in the end it don't really matter - unless you have less than 4 MB on your PC, and I doubt this is the case [smile].

HTH,

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.