python24.zip

"Martin v. Löwis" martin at v.loewis.de
Tue May 24 17:58:03 EDT 2005


Dieter Maurer wrote:
> The comparison between warm start (few disc io) and cold start
> (much disc io) tells you that the import process is highly
> io dominated (for cold starts).

Correct. However, I would expect that the contents of existing
directories is cached, and it might be that the absence of a directory
on sys.path is also cached (I know Linux does negative dentry caching).

> I know that this does not prove that the failing opens contribute
> significantly. However, a colleague reported that the
> "import.c" patch (essential for the reduction of the number of opens)
> resulted in significant (but not specified) improvements.

When I experimented with startup time for 2.4, I found that these
calls don't matter at all in any significant way (atleast not for
warm starts). Instead, I found that reducing the size of .pyc files,
by sharing interned strings, gives more speedup (and indeed, 2.4
changed the marshal format to accommodate shared interned strings).

So I would agree that IO makes a significant part of startup, but
I doubt it is directory reading (unless perhaps you have an
absent NFS server or some such).

Regards,
Martin



More information about the Python-list mailing list