Release, MinSizeRel and RelWithDebInfo

Get answers to all your basic programming questions. No Ogre questions, please!
Post Reply
User avatar
LJS
Greenskin
Posts: 138
Joined: Wed Jan 09, 2013 8:58 pm

Release, MinSizeRel and RelWithDebInfo

Post by LJS » Sat Jul 19, 2014 12:06 am

What is the difference between the Release, MinSizeRel and RelWithDebInfo. The latter is quite self explainory but the former two, would it make any difference and if so, how?

R,
0 x
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
Contact:

Re: Release, MinSizeRel and RelWithDebInfo

Post by Klaim » Sat Jul 19, 2014 11:52 am

I believe that Release is the equivalent of what Visual Studio default Release configuration is. So basically, it just provide speed optimization and no debug info.

I believe that MinSizeRel is the same than Release but the optimization configuration is setup for making the smallest binary size. For example, this propably change how the compiler will interpret inlining, to focus on producing less code. This is only useful in cases where you need the binary to be as small as possible (but you will then probably have to setup a set of very specific compilation flags in addition).

RelWithDebInfo is Release with debug info as you already have guessed.

There could be MaxSpeedRel that would optimize for speed more agressively than Release, even if it makes the binary size explode, but that makes not much sense because the binary size also impact the execution speed. So Release is a good default compromise (high performance, binary not too big) for shipping product.
0 x

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7146
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 14

Re: Release, MinSizeRel and RelWithDebInfo

Post by Kojack » Sat Jul 19, 2014 3:00 pm

Rather than MinSizeRel I'd just run UPX over the exe and dlls.
0 x

User avatar
LJS
Greenskin
Posts: 138
Joined: Wed Jan 09, 2013 8:58 pm

Re: Release, MinSizeRel and RelWithDebInfo

Post by LJS » Sat Jul 19, 2014 8:37 pm

It must be true what they say: "It takes a good dictionairy to read a good dictionairy correctly.", so have searched for UPX on bing.

As it states it compresses the dll (and decrompressing it without memory overhead). Since my by far near to full hdd can take a dll 100x bigger, doesn't matter which you seek as an example. Are there other reasons why a smaller dll is better?

P.S. assuming this goes for an executable with external media too.
0 x
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: Release, MinSizeRel and RelWithDebInfo

Post by c6burns » Sat Jul 19, 2014 8:43 pm

Systems with limited resources, like embedded environments. Or systems where many processes will all use the same shared library. These are situations where shared library size starts to matter.
0 x

User avatar
LJS
Greenskin
Posts: 138
Joined: Wed Jan 09, 2013 8:58 pm

Re: Release, MinSizeRel and RelWithDebInfo

Post by LJS » Sat Jul 19, 2014 9:07 pm

Thanks to you all.

R,
0 x
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: Release, MinSizeRel and RelWithDebInfo

Post by c6burns » Sat Jul 19, 2014 9:16 pm

c6burns wrote:Or systems where many processes will all use the same shared library.
You know I wasn't thinking straight. Above is a case where static library size really matters, because each process will need to load the static lib into memory. Shared libs are ... well ... shared between processes :oops:

Anyway along with embedded systems I would say console development can sometimes constrain how large your libs are. I never dev'd for PS3 but apparently squeezing libraries onto SPUs was an interesting game of whackamole
0 x

User avatar
LJS
Greenskin
Posts: 138
Joined: Wed Jan 09, 2013 8:58 pm

Re: Release, MinSizeRel and RelWithDebInfo

Post by LJS » Sat Jul 19, 2014 10:00 pm

For those who can't read, LJS spells NOOB, as you clearly can see :wink: .

You know good documentation where I can read more about the dynamic and statically libraries, and shared libraries (of which I am starting to think they are either dynamic or static). I mean - I'll use Ogre as example -, when I link statically (OgreMainStatic.lib) I can run the executable on a different machine without any .lib or .dll (not taking cg into account). On the other hand, when linking my project with OgreMain.dll (or any .dll), I also need to link to a small static library (OgreMain.lib) and I can run the executable as long the .dll is at the other machine too.

Would the latter (OgreMain.lib) be a shared static library and the first (OgreMainStatic.lib) 'just' a static library?

R,
0 x
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: Release, MinSizeRel and RelWithDebInfo

Post by c6burns » Sun Jul 20, 2014 12:49 am

.dll (dynamic link library) have an accompanying .lib, but the .dll itself is only loaded at runtime. static libraries put everything in the .lib and it's all mapped into your executable at compile time.

Pretty much everything you ever needed to know is on this page, or is linked from this page:
http://en.wikipedia.org/wiki/Library_%28computing%29
0 x

User avatar
LJS
Greenskin
Posts: 138
Joined: Wed Jan 09, 2013 8:58 pm

Re: Release, MinSizeRel and RelWithDebInfo

Post by LJS » Sun Jul 27, 2014 8:06 am

Thank you c6burns, have removed my insecurities about libs.

R,
0 x
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7146
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 14

Re: Release, MinSizeRel and RelWithDebInfo

Post by Kojack » Sun Jul 27, 2014 1:50 pm

UPX of ogre 1.9 results in a bin directory of 8.6MB instead of 27MB. That's not bad.
If you don't have fast hard drives, it can speed up loading too, since it's decompression is extremely fast (fast decompression can beat slow hard drives).
0 x

User avatar
LJS
Greenskin
Posts: 138
Joined: Wed Jan 09, 2013 8:58 pm

Re: Release, MinSizeRel and RelWithDebInfo

Post by LJS » Mon Jul 28, 2014 9:11 pm

If a ratio of ~33% is 'not bad' then I need to redefine my interpretation of words :wink:

Is my assumption right: "Decompressed remains in memory, so that way there isn't any loss in speed at runtime.".
0 x
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static

Post Reply