Reference count access or better method?

Alex Martelli aleax at aleax.it
Tue Jan 15 04:19:03 EST 2002


"Philip Swartzleonard" <starx at pacbell.net> wrote in message
news:Xns919691B771A2ARASXnewsDFE1 at 130.133.1.4...
    ...
> > of "events" that cause you to check what's too-old in your (registry)
> > cache -- nothing in this scheme implies such events, they just let you
> > USE such events to clean up what parts of your cache you want.
>
> Well, since i'm working on a turn-based game, I figured i can just use
> turns as the measure of time - if something hasen't been used in 100 turns
> or whatever, delete it. Also, scan only a few resources every turn,
> cycling, so that it dosen't create a single huge noticible GC cycle. (I'm

Makes sense.

> > object x of type X.  Leaving loadit bare produces lots of duplicates of
> > object x as different parts of client-code try to load S, and thus,
> > performance (as measured by profiling, of course) is unacceptable.
>
> Well, this is pretty much the idea, generator functions and all that. I'm
> really pretty clueless about how to go about profiling python code though,
> what do you use to do that?

http://www.python.org/doc/current/lib/profile.html


> > Memoizing in the simplest way, e.g (2.2 syntax for concision &c):
> > [Examples...]
>
> Memoizing makes sense, but what is concision? Niether python.org or
> dictionary.com help...

http://www.nutsandboltsguide.com/concision.html


> i wish to impede. The main thing i'm worried about is the possibility of
> dealing with lots and lots of different things like this, and moving them
> in and out of 'scope', as it were, over a long running period. But really,

A decent operating system's virtual-memory and disk-buffering management
should free you from this kind of worries.


Alex






More information about the Python-list mailing list