From ligges at statistik.tu-dortmund.de  Sun Sep  7 15:33:05 2014
From: ligges at statistik.tu-dortmund.de (Uwe Ligges)
Date: Sun, 07 Sep 2014 15:33:05 +0200
Subject: [Rd] normalizePath is sometimes very slow for nonexistent UNC
 paths
In-Reply-To: <CAPp_+=eZqqxg2jDK2NLtJ=ruG6NsTyUcD-A+LAmMGYP0ZyL4pA@mail.gmail.com>
References: <CAPp_+=eZqqxg2jDK2NLtJ=ruG6NsTyUcD-A+LAmMGYP0ZyL4pA@mail.gmail.com>
Message-ID: <540C5E91.1030009@statistik.tu-dortmund.de>



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



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