[Python-Dev] fastnames patch

Oren Tirosh oren-py-d@hishome.net
Mon, 27 May 2002 12:45:40 +0300


On Mon, May 27, 2002 at 12:32:31AM -0400, Tim Peters wrote:
> I finally got around to applying Oren's patch.  Nice work, BTW!  Here are
> before-and-after timings for the test program I posted before.  This is
> current CVS, release build, Win98SE, MSVC 6, 866MHz:
> 
>                              seconds
> function                  before  after  % speedup
> --------                  ------  -----  ---------
> fastlocals                 2.40    2.39       0
> globals_via_load_global    3.27    2.53      29
> locals_via_load_name       3.46    2.66      30
> globals_via_load_name      4.56    2.82      62
> builtins_via_load_global   5.99    4.04      48
> builtins_via_load_name     7.12    4.84      47
> 

Here are before-and-after timings for your test program. 
Python 2.2.1, Linux, gcc 2.96, 866MHz:

function                  before  after  % speedup
--------                  ------  -----  ---------
fastlocals                 2.63    2.58       2 (?!?)     
globals_via_load_global    4.04    3.43      18
builtins_via_load_global   7.87    5.64      40

Again, without INLINE_DICT_GETITEM_INTERNED:

function                  before  after  % speedup
--------                  ------  -----  ---------
fastlocals                 2.63    2.59       2
globals_via_load_global    4.04    3.55      14
builtins_via_load_global   7.87    5.66      39

It looks like the inline macro doesn't really account for much the 
improvement.

	Oren