[Python-Dev] __file__

Brett Cannon brett at python.org
Mon Mar 1 03:11:39 CET 2010


On Sun, Feb 28, 2010 at 16:31, Greg Ewing <greg.ewing at canterbury.ac.nz>wrote:

> 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.
>

But that is making the assumption that all filesystems operate this way
(.e.g does NFS have the same performance characteristics?).


>
>  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.


But that's the point: once it's warmed up. This is not the case when
executing a script once every once in a while compared to something bzr
where you are most likely going to execute the command multiple times within
a small timeframe.

-Brett




>
>
> --
> Greg
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/brett%40python.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100228/f658ea33/attachment-0001.html>


More information about the Python-Dev mailing list