develooper Front page | perl.perl5.porters | Postings from June 2016

Re: Inefficient stat-ing of files?

Thread Previous | Thread Next
June 24, 2016 15:29
Re: Inefficient stat-ing of files?
Message ID:
David Farrell wrote:
>I used strace on a Perl one liner and found that 12% of the time was spent
>stat-ing files like this:

Was it enough time to make it appreciably less responsive?  We're not
usually interested in high proportions of very short runtimes.  Also,
if you're measuring with strace, you're probably counting a lot of
per-syscall tracing overhead: with Linux's dentry caches, the actual
stat operations are pretty quick.

>                          have you considered using the directory of the
>most recent successful stat rather than cycling through directories in the
>same order?

Wouldn't help.  If a file is quickly discovered in a later @INC dir,
all the earlier ones still need to be statted, because the guaranteed
behaviour is to load the file from the earliest @INC dir where a file
of that name can be found.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About