David Roundy added the comment:

I had suspected that might be the case. At this point mostly it's just a
test case where I generated a lot of files to demonstrate the issue.  In my
test case hello world with one module import takes a minute and 40 seconds.
I could make it take longer, of course, by creating more files.

I do think scaling should be a consideration when introducing
optimizations, when if getdents is usually pretty fast.  If the script
directory is normally the last one in the search path couldn't you skip the
listing of that directory without losing your optimization?

On Sat, Apr 11, 2015, 1:37 PM Antoine Pitrou <rep...@bugs.python.org> wrote:

>
> Antoine Pitrou added the comment:
>
> This change is actually an optimization. The directory is only read once
> and its contents are then cached, which allows for much quicker imports
> when multiple modules are in the directory (common case of a Python
> package).
>
> Can you tell us more about your setup?
> - how many files are in the directory
> - what filesystem is used
> - whether the filesystem is local or remote (e.g. network-attached)
> - your OS and OS version
>
> Also, how long is "very slowly"?
>
> ----------
> nosy: +pitrou
>
> _______________________________________
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue23916>
> _______________________________________
>

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23916>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to