[Python-Dev] __file__

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 1 01:31:17 CET 2010


Robert Collins wrote:
> In the special
> case of probing for $name.$ext1, ...$ext2, ...$ext3, you generally hit
> the same pages and don't incur additional page in costs.

So then looking for a .pyc alongside a .py or vice versa
should be almost free, and we shouldn't be worrying about
it.

> hot cache:
> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>  45.10    0.000368          92         4           getdents
>   0.00    0.000000           0       734       625 stat

Further supporting the idea that stat calls are negligible
once the cache is warmed up.

-- 
Greg


More information about the Python-Dev mailing list