[Python-Dev] Accessing globals without dict lookup (original) (raw)

Tim Peters tim.one@comcast.net
Tue, 12 Feb 2002 15:17:50 -0500


[Tim]

Speaking of which, why does LOADFAST waste time checking against NULL twice?!

[Neil Schemenauer]

If you would have approved my patch it would be fixed already.

Heh. If you had entered the patch at priority 9, I might have gotten to it by this summer. At priority 3, we're talking years <wink/sigh>. I boosted it to 6. Note that the tiny patch I checked in also rearranged the code so that the mormal case became the fall-through case:

if (normal)
    do normal stuff
else do exceptional stuff

Most dumb compilers on platforms that care use a "forward branches probably aren't taken, backward branches probably are" heuristic for setting branch-prediction hints in the machine code; and on platforms that don't care it's usually faster to fall through than to change the program counter anyway.

one-small-banana-left-ly y'rs Neil

is-that-an-american-or-canadian-banana?-ly y'rs - tim