[Python-Dev] Proposed PEP: Optimizing Global Variable and Attribute Access

Roman Suzi rnd at onego.ru
Tue Aug 14 12:24:37 CEST 2001


On Tue, 14 Aug 2001, Alex Martelli wrote:

> "Roman Suzi" <rnd at onego.ru> wrote in message
> news:mailman.997770921.12166.python-list at python.org...
> > On Tue, 14 Aug 2001, Skip Montanaro wrote:
> >
> > >         TRACK_OBJECT       math.sin
> > >         ...
> > >         LOAD_FAST          math.sin
> > >         ...
> > >         UNTRACK_OBJECT     math.sin
> >
> > What about threads? What if math.sin changes while in cache?
> 
> Isn't that exactly what TRACK_OBJECT *means*?!  If the
> tracked object changes, whatever thread perpetrates the
> change, the cache will be updated.

Oh... Threads are mentioned only once in the end of PEP.
Another good question: what about generators? They aren't
explicitly mentioned.  (And they are... err... potentioally
active).

If I understood correctly, tracked objects must be mostly
applied to "constants". This assumption could lead to
fast read. How fast write operation is is irrelevant.

I do not understand the following:

    The number of tracked objects should be relatively small.  All active
    frames of all active threads could conceivably be tracking objects, but
    this seems small compared to the number of functions defined in a given
    application.

How small the number of tracked objects should be?
Will there be another arbitrary limit (like stack size)?
(Related ques: are there plans to remove stack-limit in Python?


Sincerely yours, Roman A.Suzi
-- 
 - Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -
 








More information about the Python-list mailing list