Re: about the Just-In-Time(JIT) compiler
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Tue, 21 Apr 2009 19:58:50 -0400
Michael B. Trausch wrote:
On Tue, 21 Apr 2009 12:06:47 -0500
"Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx> wrote:
Huh? -Os is the best in most scenarios, I use it unless I have a
good reason to go tweaking optimization. Smaller = better use of
icache = (almost always) faster.
But -Os is not standard---that is, it's not the ubiquitous optimization
flag used. -O2 is a de facto standard in that its usage is pretty well
ubiquitous. It is at least the default for Debian and Debian-derived
distributions, and might also be for Red Hat/CentOS/Fedora, though I
don't have a system in that family to check at present.
Most distributions that I am aware of (Debian and Ubuntu, for sure, and
I know that Slackware and other distributions that I have used or tried
at various points) use -O2. There are _some_ packages that are built
with -Os, though it's been long enough since I have seen them that I no
longer remember what they are. So, using -Os would skew the result
from what a standard package manager would use to build the software,
which is what I was interested in.
-O2 may very well be the standard.
But I often use -O3.
Also, I don't see a major difference between -O2 and -Os:
-rwxr-xr-x 1 mbt mbt 93936 2009-04-21 16:49 alltray.-O2*
-rwxr-xr-x 1 mbt mbt 89840 2009-04-21 16:49 alltray.-Os*
The binary compiled with -Os is exactly 4KiB smaller, which doesn't
improve anything (at least on this system). On a system that uses 4KiB
pages, you save one page; on a system that uses 2MB pages, you save
nothing, and the cache is big enough that 4KiB isn't going to matter
anyway, I don't think.
I don't think that the difference in size of executables on disk will
always match the difference in memory usage when running.
Arne
.
- Follow-Ups:
- Re: about the Just-In-Time(JIT) compiler
- From: Michael B. Trausch
- Re: about the Just-In-Time(JIT) compiler
- References:
- about the Just-In-Time(JIT) compiler
- From: Tony Johansson
- Re: about the Just-In-Time(JIT) compiler
- From: Hans Kesting
- Re: about the Just-In-Time(JIT) compiler
- From: Ben Voigt [C++ MVP]
- Re: about the Just-In-Time(JIT) compiler
- From: Michael B. Trausch
- Re: about the Just-In-Time(JIT) compiler
- From: Arne Vajhøj
- Re: about the Just-In-Time(JIT) compiler
- From: Michael B. Trausch
- Re: about the Just-In-Time(JIT) compiler
- From: Arne Vajhøj
- Re: about the Just-In-Time(JIT) compiler
- From: Michael B. Trausch
- Re: about the Just-In-Time(JIT) compiler
- From: Arne Vajhøj
- Re: about the Just-In-Time(JIT) compiler
- From: Michael B. Trausch
- Re: about the Just-In-Time(JIT) compiler
- From: Arne Vajhøj
- Re: about the Just-In-Time(JIT) compiler
- From: Michael B. Trausch
- Re: about the Just-In-Time(JIT) compiler
- From: Ben Voigt [C++ MVP]
- Re: about the Just-In-Time(JIT) compiler
- From: Michael B. Trausch
- about the Just-In-Time(JIT) compiler
- Prev by Date: Re: Multiple blanks
- Next by Date: Is this Threadsafe?
- Previous by thread: Re: about the Just-In-Time(JIT) compiler
- Next by thread: Re: about the Just-In-Time(JIT) compiler
- Index(es):
Relevant Pages
|