Re: Caches, caches...

Guido.van.Rossum@cwi.nl
Wed, 16 Mar 1994 17:24:49 +0100

> Why not try another directory instead? Like /usr/tmp or whatever. I always
> thought it was a weak point that you either have to precompile every and
> each module or have write permissions to the library directory. It would be
> nice if there were a cache directory for this purpose that can be made
> writable for anybody (a la /usr/tmp), although you would have to introduce
> some naming scheme or subdirectory structure to distinguish identically
> named modules in different locations.

Hmm... And then we will get complaints because Python creates lots of
files in /usr/tmp and doesn't clean them up. But if someone
contributes a working implementation (hint: it's all in
Python/import.c) I would consider incorporating it.

> This brings up another interesting point: are the .pyc files guarded against
> concurrent generation?

Yes. The timestamp and magic number are written last, in one write
operation.

> If you really want this, I would see it more as a debugging aid for the
> programmer/sysadmin and disable it by default and enable it by, say, a
> variable in sys or a command line option. :-)

Our reasoning was that you can already get these messages with python
-v, but that in this particular case one would like to receive a
gentle warning that there might be a (startup) efficiency problem.

>From the first few responses it seems that maybe we underestimated the
impact of warnings...

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>