Re: compiler optimizations [was: i686 repository]

From: Michal Zeravik (michalz_at_olomouc.com)
Date: 03/09/04

  • Next message: Tom Needs a Hat Mitchell: "Re: ethernet to dialup transition"
    To: fedora-list@redhat.com
    Date: Tue, 09 Mar 2004 21:37:21 +0100
    
    

    Hi Florin,

    I tried to recompile quanta 3.2 (very slow app)
    and It seems to be about 10% faster with cflags set for athlon-xp.
    Now I'm trying to rebuild kde32 and going to rebuild X.
    What are chances in optimizing multimedia application
    for runtime speed and stability?

    michal

    Florin Andrei wrote:

    >On Tue, 2004-03-09 at 05:25, Phil Hannent wrote:
    >
    >
    >
    >>Does anyone know of a repository that has i686 binaries compiled for fedora?
    >>While the argument is that there isn't much benefit from having
    >>optimised binaries, the fact that Gentoo linux exists shows there is a
    >>demand.
    >>
    >>
    >
    >For normal packages you shouldn't need a thorough optimization, because
    >the gains are so small it's difficult to even measure them.
    >And by the way, optimizing for i686 is a "suboptimal optimization" :-)
    >nowadays.
    >
    >I just use the default packages most of the time. There are cases when
    >an aggressive optimization is desireable and yields measurable results
    >(multimedia apps such as transcoders, music apps, etc.), but then you
    >have to perform a full optimization on them.
    >
    >As a rule, if an application does not fall under at least one of these
    >categories, it's not worth pursuing aggressive optimizations:
    >- it runs at 100% CPU usage for a long time (e.g. when transcoding from
    >DVD to DivX)
    >- it has to deliver very low latency (e.g. when recording audio with the
    >computer)
    >If at least one criterion is satisfied, you may try to optimize (but
    >don't expect miracles every single time).
    >
    >Myself, i compile (rebuild RPMs) those apps with "-march=athlon-xp
    >-mcpu=athlon-xp" (because my system is an AthlonXP/1800) and some other
    >minor tweaks. I keep that in my ~/.rpmrc file (sorry if my mailer splits
    >the line):
    >
    >optflags: athlon -O3 -march=athlon-xp -mcpu=athlon-xp -mfpmath=sse -pipe
    >-fomit-frame-pointer
    >
    >But remember, i'm for the most part focused on multimedia type of
    >things.
    >
    >Often, the difference between -O2 and -O3 is bigger than what
    >-march=athlon-xp provides (and no, -O3 is not always faster). Also, all
    >those -fomit-frame-pointer type of arcane options can deliver unexpected
    >results.
    >
    >There is no such thing as "this is The Magic Gcc Option that will make
    >all your apps run 10x faster". Optimizing apps is DIFFICULT. What are
    >you optimizing for? Speed? Latency? Memory usage? Are you running other
    >apps at the same time? How big is your CPU's cache? Are you sure the
    >app's code can take advantage of all those gcc bells and whistles? And
    >last but not least, do you know how to properly benchmark different
    >application versions?
    >
    >Believe me, optimizing an app is like cracking open a clockwork puppet:
    >all of a sudden all kinds of tiny little springs and gear pop out of
    >nowhere, leaving you scratching your head and asking yourself how the
    >hell are you going to put all that back inside.
    >
    >If you really want to squeeze all speed out of an app, you'll spend an
    >incredible amount of time tweaking gcc options and doing benchmarks for
    >days and weeks. And then a minor detail changes with the conditions
    >(like, you start using another app at the same time) and that changes
    >everything. :-(
    >It sucks. Just use some generic optimizations, you'll do yourself a
    >service. Unless your needs are very special, such as if you build some
    >kind of appliance or something (but then you probably wouldn't use a
    >generic distribution such as Fedora).
    >
    >
    >

    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Tom Needs a Hat Mitchell: "Re: ethernet to dialup transition"

    Relevant Pages

    • Re: Crashes when I open Sent Items Folder
      ... I am trying to rebuild my database and I am either ... getting a message 'quit all MS apps (all apps are quit and reminders are ... Then in both cases, Entourage quits. ...
      (microsoft.public.mac.office.entourage)
    • Re: No app frame for Java application
      ... > pop-up frames. ... not only the apps that you programmed are wrong? ... what do you mean by "rebuild"? ... Andi ...
      (comp.lang.java.gui)
    • XP SP2 and sound
      ... I've had to rebuild my PC because WinXPSP2 caused my previous system ... applied SP2 and and the rest of my apps. ... that the sound on some of my movies do not playback. ...
      (microsoft.public.windowsxp.help_and_support)
    • Re: ghostview missing libc.so.4?
      ... >>easy to do when the apps I need don't even work properly. ... Shlib version numbers are changed for a reason. ... Instead either install the misc/compat4x port or else set COMPAT4X=yes ... in /etc/make.conf and rebuild your world. ...
      (freebsd-questions)