Re: about the Just-In-Time(JIT) compiler

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: Yet Another Recommendation Request: Noob, user (not server), just to fool around...
    ... Debian can be seen as a rich, complex, evolving toolkit for constructing ... Debian-derivative distributions, such as Xandros Desktop OS, ... consider the Ubuntu Linux project: ... possible useful Debian installers (mechanisms useful for creating Debian ...
    (comp.os.linux.misc)
  • Re: An example of why Linux is not ready for flatfish
    ... The Linux distributions jungle has no winner at present but main ... _ Debian package compilation is a mess. ... Debian upgrade is easier. ... _ GTK/Gnome has the old X11 look and feel and QT/KDE is ice candy. ...
    (alt.os.linux)
  • Re: Downloading Debian CDs or DVD(s)?
    ... > I think I will take your advice about the Knoppix derivatives. ... All three distributions are strongly based on Debian. ... to handle packages in Debian's ".deb" package format. ...
    (comp.os.linux.misc)
  • Re: Building two servers
    ... >> I do see chances for trouble with hardware supported only with other ... I know Red Hat does not ship ... Most venders refer to certain distributions only, ... But Debian is not mentioned there. ...
    (Debian-User)
  • Re: Please help me get started
    ... > of the attractions of Linux was that it was a free OS. ... > find a bewildering number of distributions (Debian, SUSE, ... I'd recommend Debian. ... Start with a minimal install and use apt to add the programs ...
    (comp.os.linux.misc)