[Python-Dev] Re: opcode performance measurements

Jeremy Hylton jeremy@alum.mit.edu
Fri, 1 Feb 2002 07:59:52 -0500

>>>>> "SP" == Samuele Pedroni <pedronis@bluewin.ch> writes:

  SP> But it is clear that the complexity and overhead of (1) and (2),
  SP> and the space-demand for the caches depend on how much
  SP> homogeneous are system object layouts and behaviors.

Good point!  It's important to try to extract the general principles
at work and see how they can be applied systematically.  The general
notion I have is that dictionaries are not an efficient way to
implement namespaces.  The way most namespaces are used -- in
particular that most names are known statically -- allows a more
efficient implement.

  SP> And Python with modules, data-objects, class/instances, types
  SP> etc is quite a zoo :(.

And, again, this is a problem.  The same sorts of techniques apply to
all namespaces.  It would be good to try to make the approach
general, but some namespaces are more dynamic than others.  Python's
classes, lack of declarations, and separate compilation of modules
means class/instance namespaces are hard to do right.  Need to defer a
lot of final decisions to runtime and keep an extra dictionary around
just in case.

  SP> Pushing the class/type unification further, this is an aspect to
  SP> consider IMHO.

  SP> If those things where already all known sorry for the boring
  SP> post.

Thanks for good questions and suggestions.  Too bad you can't come to
dev day.  I'll try to post slides before or after the talk -- and
update the PEP.