[Tutor] Re: display filter slow

Prahlad Vaidyanathan slime@vsnl.net
Tue, 18 Dec 2001 11:10:41 +0530

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


On Mon, 17 Dec 2001 Prahlad Vaidyanathan spewed into the ether:
[-- snip --]
> As you can see, the script takes nearly thrice the amount of time as
> without it. I'm sure there is a more efficient way of filtering my mail,
> so any help would be appreciated.

I know replying to one's own post is a Bad Thing, but I found out on my
own, so I thought I should post it.

The reason it was taking so long to start was that the python
interpreter itself was taking a very long time to load. On startup, the
interpreter tries to import a whole bunch of site-packages. All the
packages it tried to import had a 'bad mtime' - hence it tried to
byte-compile the .py file into the .pyc equivalent. Since I didn't have
write-access to the /usr/lib/python2.0 directory, it complained, but
continued nonetheless. But, the delay involved in recongising and
reporting this problem caused the overall delay of the script.

Now, what I want to know is this :

* Why did python try importing a whole bunch of site-packages when I did
not give explicit instructions to import them

* Why were the mtimes for the .pyc files bad (This is prolly a problem
with my personal python package, but maybe it's universal)

I solved this problem by just giving myself write-access to the
/usr/lib/python2.0 directory. But, this is only possible on my home
system where I know the root password - on other systems it is not. I
would like to know how one would solve this if one didn't have root

I hope I have been clear. I have attached a (slightly) updated version
of the script I posted yesterday. It works right now, but I hope to add
a few more features to it soon. Any feedback is welcome :-)


Prahlad Vaidyanathan <slime@vsnl.net>                What, me worry ?
http://www.symonds.net/~prahladv/                    Don't Panic !

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org