[Rd] normalizePath is sometimes very slow for nonexistent UNC paths

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Sep 7 15:33:05 CEST 2014



On 07.09.2014 10:07, Richard Cotton wrote:
> I'm having an issue with occasionally slow-running calls to
> normalizePath.  If the path is a non-existent UNC path, then
> normalizePath sometimes takes 6 or 7 seconds to run, rather than its
> usual few microseconds.  My big problem is that I can't reliably
> reproduce this across machines.
>
> The example below generates one or two slow runs out of 10000 on my
> Windows machine. I haven't been able to generate slow runs on my Linux
> machine, though I've had problems with slow running examples submitted
> to CRAN that I suspect may be caused by this.
>
> library(microbenchmark)
> (timings <- microbenchmark(
>    normalizePath("\\\\some/network/drive", mustWork = FALSE),
>    times = 1e4,
>    unit  = "s"
> ))
> boxplot(timings)


It is an OS "problem": You r OS tries to find some and has to look 
around waiting for responses. Hence you run into timeouts. If the cached 
result says some does not exist, you are quick...

Best,
Uwe Ligges



> Please can a few people run this code and see if they can reproduce the issue.
>
> It isn't clear to me whether this is a bug in R or an underlying OS or
> network problem.
>



More information about the R-devel mailing list