[Python-Dev] Accessing globals without dict lookup

Skip Montanaro skip@pobox.com
Tue, 12 Feb 2002 21:54:01 -0600

    Tim> Maybe more interesting: One of the folks at Zope Corp reported
    Tim> getting significant speedups by using some gcc option that can feed
    Tim> real-life branch histories back into the compiler.  Less work and
    Tim> less error-prone than guessing annotations.

That would be -fprofile-args and -fbranch-probabilities:

    -fprofile-arcs also makes it possible to estimate branch probabilities,
    and to calculate basic block execution counts.  In general, basic block
    execution counts do not give enough information to estimate all branch
    probabilities.  When the compiled program exits, it saves the arc
    execution counts to a file called sourcename.da.  Use the compiler
    option -fbranch-probabilities when recompiling, to optimize using
    estimated branch probabilities.

I fiddled with a bunch of gcc options a few months ago.  I finally settled

    -O3 -minline-all-stringops -fomit-frame-pointer