Rstudio Startup time ~40 seconds

#1

Hi,

Recently (past few weeks), RStudio startup time has been very slow. Same happens with restarting RStudio.

I am not sure the cause of this. I am using the latest daily build as of now (1.2.1326).

What operating system and version of R are you using?
A. Windows 7 Enterprise version 6.1.7601

Can you run a diagnostic report and send us the output?

[1] "1.2.1326"

$R
[1] "C:\Users\user\DOCUME~1\R\R-35~1.3\bin\x64\R.exe"

$pdflatex
[1] "C:\Users\user\AppData\Local\Programs\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe"

$bibtex
[1] "C:\Users\user\AppData\Local\Programs\MIKTEX~1.9\miktex\bin\x64\bibtex.exe"

$gcc
[1] ""

$git
[1] "C:\Users\user\AppData\Local\Programs\Git\cmd\git.exe"

$svn
[1] ""

R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_3.5.3 rsconnect_0.8.13 tools_3.5.3 packrat_0.5.0

SysInfo:
sysname release version
"Windows" "7 x64" "build 7601, Service Pack 1"
nodename machine login
"" "x86-64" "user"
user effective_user
"user" "user"

R Version:
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 5.3
year 2019
month 03
day 11
svn rev 76217
language R
version.string R version 3.5.3 (2019-03-11)
nickname Great Truth
$ADAPTIVACLIENT
[1] "C:\Program Files (x86)\Adaptiva\AdaptivaClient"

$ALLUSERSPROFILE
[1] "C:\ProgramData"

$APPDATA
[1] "C:\Users\user\AppData\Roaming"

$ChocolateyInstall
[1] "C:\ProgramData\chocolatey"

$ChocolateyLastPathUpdate
[1] "Wed Jan 23 15:30:02 2019"

$CLICOLOR_FORCE
[1] "1"

$CommonProgramFiles
[1] "C:\Program Files\Common Files"

$CommonProgramFiles(x86)
[1] "C:\Program Files (x86)\Common Files"

$CommonProgramW6432
[1] "C:\Program Files\Common Files"

$ComSpec
[1] "C:\WINDOWS\system32\cmd.exe"

$DISPLAY
[1] ":0"

$FP_NO_HOST_CHECK
[1] "NO"

$GFORTRAN_STDERR_UNIT
[1] "-1"

$GFORTRAN_STDOUT_UNIT
[1] "-1"

$HOME
[1] "C:/Users/user/Documents"

$HOMEDRIVE
[1] "C:"

$HOMEPATH
[1] "\Users\user"

$LOCALAPPDATA
[1] "C:\Users\user\AppData\Local"

$LOGONSERVER
[1] "\\ADDC30-CHA"

$MSYS2_ENV_CONV_EXCL
[1] "R_ARCH"

$NUMBER_OF_PROCESSORS
[1] "8"

$OS
[1] "Windows_NT"

$PATH
[1] "C:\Users\user\Documents\R\R-3.5.3\bin\x64;C:\Program Files\ImageMagick-7.0.7-Q16;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\wkstnctl\Support\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\WebEx\Productivity Tools;C:\Users\user\AppData\Local\Programs\Python\Python36-32;C:\Users\user\Documents\R\R-3.4.3\bin\;C:\Program Files\PolicyPak\;C:\Program Files (x86)\Google\Chrome\Application;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\wkstnctl\Support\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Enterprise Vault\EVClient\x64\;C:\Program Files\PolicyPak\;C:\Users\user\AppData\Local\Programs\Git\cmd;C:\Users\user\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;C:\Users\user\AppData\Local\Pandoc\"

$PATHEXT
[1] ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"

$PROCESSOR_ARCHITECTURE
[1] "AMD64"

$PROCESSOR_IDENTIFIER
[1] "Intel64 Family 6 Model 94 Stepping 3, GenuineIntel"

$PROCESSOR_LEVEL
[1] "6"

$PROCESSOR_REVISION
[1] "5e03"

$ProgramData
[1] "C:\ProgramData"

$ProgramFiles
[1] "C:\Program Files"

$ProgramFiles(x86)
[1] "C:\Program Files (x86)"

$ProgramW6432
[1] "C:\Program Files"

$PSModulePath
[1] "C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\"

$PUBLIC
[1] "C:\Users\Public"

$QT_D3DCREATE_MULTITHREADED
[1] "1"

$R_ARCH
[1] "/x64"

$R_COMPILED_BY
[1] "gcc 4.9.3"

$R_DOC_DIR
[1] "C:/Users/user/DOCUME~1/R/R-35~1.3/doc"

$R_HOME
[1] "C:/Users/user/DOCUME~1/R/R-35~1.3"

$R_LIBS_USER
[1] "C:/Users/user/Documents/R/win-library/3.5"

$R_PACKRAT_DEFAULT_LIBPATHS
[1] "C:/Users/user/Documents/R/R-3.5.3/library"

$R_PACKRAT_SYSTEM_LIBRARY
[1] "C:/Users/user/DOCUME~1/R/R-35~1.3/library"

$R_USER
[1] "C:/Users/user/Documents"

$RMARKDOWN_MATHJAX_PATH
[1] "C:/Users/user/Documents/RStudio/resources/mathjax-26"

$RS_LOCAL_PEER
[1] "\\.\pipe\18786-rsession"

$RS_RPOSTBACK_PATH
[1] "C:/Users/user/Documents/RStudio/bin/rpostback"

$RSTUDIO
[1] "1"

$RSTUDIO_CONSOLE_COLOR
[1] "256"

$RSTUDIO_CONSOLE_WIDTH
[1] "80"

$RSTUDIO_MSYS_SSH
[1] "C:/Users/user/Documents/RStudio/bin/msys-ssh-1000-18"

$RSTUDIO_PANDOC
[1] "C:/Users/user/Documents/RStudio/bin/pandoc"

$RSTUDIO_SESSION_PORT
[1] "18786"

$RSTUDIO_USER_IDENTITY
[1] "user"

$RSTUDIO_WINUTILS
[1] "C:/Users/user/Documents/RStudio/bin/winutils"

$SESSIONNAME
[1] "Console"

$SynaProgDir
[1] "Dell\Touchpad"

$SystemDrive
[1] "C:"

$SystemRoot
[1] "C:\WINDOWS"

$TEMP
[1] "C:\Users\user\AppData\Local\Temp"

$TERM
[1] "xterm-256color"

$TMP
[1] "C:\Users\user\AppData\Local\Temp"

$UATDATA
[1] "C:\WINDOWS\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77"

$USERDNSDOMAIN
[1] ""

$USERDOMAIN
[1] "AD"

$USERDOMAIN_ROAMINGPROFILE
[1] "AD"

$USERNAME
[1] "user"

$USERPROFILE
[1] "C:\Users\user"

$windir
[1] "C:\WINDOWS"

$windows_tracing_flags
[1] "3"

$windows_tracing_logfile
[1] "C:\BVTBin\Tests\installpackage\csilogfile.log"

[1] ".GlobalEnv" "tools:rstudio" "package:stats" "package:graphics"
[5] "package:grDevices" "package:utils" "package:datasets" "package:methods"
[9] "Autoloads" "package:base"

0 Likes

#2

Some follow-up questions:

  1. Do you observe this with all projects, or just the current project you're working with?
  2. I see you have Packrat loaded -- are you using Packrat with your project?

It's possible some of the slowness is caused by R code that RStudio is running behind the scenes. Can you try running an R profile? Try the following:

Within R, execute:

file.edit("~/.Rprofile")

to edit your global .Rprofile. In that file, try adding:

Rprof("~/rstudio-trace.Rprof")

After doing this, close RStudio, then re-launch it. After RStudio has successfully launched, run:

Rprof(NULL)

Then, find the file at "~/rstudio-trace.Rprof", and share it with us.

You can also try sharing the printed output of

summaryRprof("~/rstudio-trace.Rprof")

directly, as that may point us towards what we need to know.

0 Likes

#3

When I followed your steps, on re-launch, this came out of the console:

Error in Rprof("~/rstudio-trace.Rprof") : could not find function "Rprof" > Rprof(NULL)
summaryRprof("~/rstudio-trace.Rprof")
$by.self [1] self.time self.pct total.time total.pct <0 rows> (or 0-length row.names) $by.total [1] total.time total.pct self.time self.pct <0 rows> (or 0-length row.names) $sample.interval [1] 0.02 $sampling.time [1] 0

Edit: I am not using packrat.

0 Likes

#4

Sorry -- please try once more with utils:: prefixed, e.g.

utils::Rprof("~/rstudio-trace.Rprof")
0 Likes

#5

$by.self
self.time self.pct total.time total.pct
"file.exists" 0.44 15.49 0.44 15.49
"base::list.dirs" 0.42 14.79 0.42 14.79
"source" 0.36 12.68 0.64 22.54
"gzfile" 0.24 8.45 0.24 8.45
"file" 0.18 6.34 0.18 6.34
"normalizePath" 0.12 4.23 0.12 4.23
"lazyLoadDBfetch" 0.08 2.82 0.08 2.82
"inDL" 0.06 2.11 0.06 2.11
"eval" 0.04 1.41 0.70 24.65
"FUN" 0.04 1.41 0.42 14.79
"findLocalsList1" 0.04 1.41 0.08 2.82
"formals" 0.04 1.41 0.06 2.11
"paste" 0.04 1.41 0.06 2.11
".Call" 0.04 1.41 0.04 1.41
"assign" 0.04 1.41 0.04 1.41
"file.access" 0.04 1.41 0.04 1.41
"parent.env" 0.04 1.41 0.04 1.41
"tools::startDynamicHelp" 0.04 1.41 0.04 1.41
"" 0.02 0.70 0.90 31.69
"loadNamespace" 0.02 0.70 0.60 21.13
"lapply" 0.02 0.70 0.40 14.08
"packageEvent" 0.02 0.70 0.18 6.34
".rs.addFunction" 0.02 0.70 0.08 2.82
"deparse" 0.02 0.70 0.06 2.11
".rs.setVar" 0.02 0.70 0.04 1.41
"lazyLoadDBexec" 0.02 0.70 0.04 1.41
"unique" 0.02 0.70 0.04 1.41
"%in%" 0.02 0.70 0.02 0.70
"basename" 0.02 0.70 0.02 0.70
"c" 0.02 0.70 0.02 0.70
"delayedAssign" 0.02 0.70 0.02 0.70
"dir.exists" 0.02 0.70 0.02 0.70
"gettext" 0.02 0.70 0.02 0.70
"grepl" 0.02 0.70 0.02 0.70
"lengths" 0.02 0.70 0.02 0.70
"list.files" 0.02 0.70 0.02 0.70
"new.env" 0.02 0.70 0.02 0.70
"NextMethod" 0.02 0.70 0.02 0.70
"objects" 0.02 0.70 0.02 0.70
"options" 0.02 0.70 0.02 0.70
"pmatch" 0.02 0.70 0.02 0.70
"putconst" 0.02 0.70 0.02 0.70
"strsplit" 0.02 0.70 0.02 0.70
"sys.parent" 0.02 0.70 0.02 0.70
"tempfile" 0.02 0.70 0.02 0.70

$by.total
total.time total.pct self.time self.pct
"doTryCatch" 2.30 80.99 0.00 0.00
"tryCatch" 2.30 80.99 0.00 0.00
"tryCatchList" 2.30 80.99 0.00 0.00
"tryCatchOne" 2.30 80.99 0.00 0.00
"base::try" 1.36 47.89 0.00 0.00
"" 0.90 31.69 0.02 0.70
"eval" 0.70 24.65 0.04 1.41
".rs.packages.initialize" 0.68 23.94 0.00 0.00
".rs.updatePackageEvents" 0.68 23.94 0.00 0.00
"eval.parent" 0.66 23.24 0.00 0.00
"local" 0.66 23.24 0.00 0.00
"source" 0.64 22.54 0.36 12.68
"loadNamespace" 0.60 21.13 0.02 0.70
".First.sys" 0.54 19.01 0.00 0.00
"library" 0.54 19.01 0.00 0.00
"require" 0.54 19.01 0.00 0.00
"file.exists" 0.44 15.49 0.44 15.49
"base::list.dirs" 0.42 14.79 0.42 14.79
"FUN" 0.42 14.79 0.04 1.41
"lapply" 0.40 14.08 0.02 0.70
"sapply" 0.28 9.86 0.00 0.00
"gzfile" 0.24 8.45 0.24 8.45
"getNamespace" 0.24 8.45 0.00 0.00
"readRDS" 0.22 7.75 0.00 0.00
"file" 0.18 6.34 0.18 6.34
"packageEvent" 0.18 6.34 0.02 0.70
"cmpfun" 0.18 6.34 0.00 0.00
"compiler:::tryCmpfun" 0.18 6.34 0.00 0.00
"system.file" 0.18 6.34 0.00 0.00
":::" 0.16 5.63 0.00 0.00
"asNamespace" 0.16 5.63 0.00 0.00
"get" 0.16 5.63 0.00 0.00
"library.dynam" 0.16 5.63 0.00 0.00
".rs.discoverPackageDependencies" 0.14 4.93 0.00 0.00
"cmp" 0.14 4.93 0.00 0.00
"cmpCall" 0.14 4.93 0.00 0.00
"genCode" 0.14 4.93 0.00 0.00
"tryInline" 0.14 4.93 0.00 0.00
"normalizePath" 0.12 4.23 0.12 4.23
".rs.httpdPort" 0.12 4.23 0.00 0.00
".rs.httpdPortIsFunction" 0.12 4.23 0.00 0.00
"match.arg" 0.12 4.23 0.00 0.00
"vapply" 0.12 4.23 0.00 0.00
"find.package" 0.10 3.52 0.00 0.00
"h" 0.10 3.52 0.00 0.00
"withVisible" 0.10 3.52 0.00 0.00
"lazyLoadDBfetch" 0.08 2.82 0.08 2.82
"findLocalsList1" 0.08 2.82 0.04 1.41
".rs.addFunction" 0.08 2.82 0.02 0.70
".rs.availablePackages" 0.08 2.82 0.00 0.00
".rs.isPackageInstalled" 0.08 2.82 0.00 0.00
"findLocalsList" 0.08 2.82 0.00 0.00
"funEnv" 0.08 2.82 0.00 0.00
"make.functionContext" 0.08 2.82 0.00 0.00
"package_version" 0.08 2.82 0.00 0.00
"sys.source" 0.08 2.82 0.00 0.00
"try" 0.08 2.82 0.00 0.00
"inDL" 0.06 2.11 0.06 2.11
"formals" 0.06 2.11 0.04 1.41
"paste" 0.06 2.11 0.04 1.41
"deparse" 0.06 2.11 0.02 0.70
".rs.onAvailablePackagesStale" 0.06 2.11 0.00 0.00
"cmpSymbolAssign" 0.06 2.11 0.00 0.00
"dyn.load" 0.06 2.11 0.00 0.00
"file.path" 0.06 2.11 0.00 0.00
"makeNamespace" 0.06 2.11 0.00 0.00
"mode" 0.06 2.11 0.00 0.00
"parse" 0.06 2.11 0.00 0.00
"setNamespaceInfo" 0.06 2.11 0.00 0.00
".Call" 0.04 1.41 0.04 1.41
"assign" 0.04 1.41 0.04 1.41
"file.access" 0.04 1.41 0.04 1.41
"parent.env" 0.04 1.41 0.04 1.41
"tools::startDynamicHelp" 0.04 1.41 0.04 1.41
".rs.setVar" 0.04 1.41 0.02 0.70
"lazyLoadDBexec" 0.04 1.41 0.02 0.70
"unique" 0.04 1.41 0.02 0.70
".make_numeric_version" 0.04 1.41 0.00 0.00
".rs.getPackageVersion" 0.04 1.41 0.00 0.00
".rs.runAsyncRProcess" 0.04 1.41 0.00 0.00
"exists" 0.04 1.41 0.00 0.00
"findCenvVar" 0.04 1.41 0.00 0.00
"getInlineHandler" 0.04 1.41 0.00 0.00
"getInlineInfo" 0.04 1.41 0.00 0.00
"getRversion" 0.04 1.41 0.00 0.00
"lazyLoad" 0.04 1.41 0.00 0.00
"R_system_version" 0.04 1.41 0.00 0.00
"runHook" 0.04 1.41 0.00 0.00
"suppressMessages" 0.04 1.41 0.00 0.00
"suppressWarnings" 0.04 1.41 0.00 0.00
"testRversion" 0.04 1.41 0.00 0.00
"utils:::packageDescription" 0.04 1.41 0.00 0.00
"withCallingHandlers" 0.04 1.41 0.00 0.00
"%in%" 0.02 0.70 0.02 0.70
"basename" 0.02 0.70 0.02 0.70
"c" 0.02 0.70 0.02 0.70
"delayedAssign" 0.02 0.70 0.02 0.70
"dir.exists" 0.02 0.70 0.02 0.70
"gettext" 0.02 0.70 0.02 0.70
"grepl" 0.02 0.70 0.02 0.70
"lengths" 0.02 0.70 0.02 0.70
"list.files" 0.02 0.70 0.02 0.70
"new.env" 0.02 0.70 0.02 0.70
"NextMethod" 0.02 0.70 0.02 0.70
"objects" 0.02 0.70 0.02 0.70
"options" 0.02 0.70 0.02 0.70
"pmatch" 0.02 0.70 0.02 0.70
"putconst" 0.02 0.70 0.02 0.70
"strsplit" 0.02 0.70 0.02 0.70
"sys.parent" 0.02 0.70 0.02 0.70
"tempfile" 0.02 0.70 0.02 0.70
".deparseOpts" 0.02 0.70 0.00 0.00
".encode_numeric_version" 0.02 0.70 0.00 0.00
".registerS3method" 0.02 0.70 0.00 0.00
".rs.availablePackagesState" 0.02 0.70 0.00 0.00
".rs.defaultLibPathIsWriteable" 0.02 0.70 0.00 0.00
".rs.dirExists" 0.02 0.70 0.00 0.00
".rs.getPackageRStudioProtocol" 0.02 0.70 0.00 0.00
".rs.isLibraryWriteable" 0.02 0.70 0.00 0.00
"[" 0.02 0.70 0.00 0.00
"[.simple.list" 0.02 0.70 0.00 0.00
"assignWrapped" 0.02 0.70 0.00 0.00
"cb$putcode" 0.02 0.70 0.00 0.00
"cb$putconst" 0.02 0.70 0.00 0.00
"cmpCallArgs" 0.02 0.70 0.00 0.00
"cmpCallSymFun" 0.02 0.70 0.00 0.00
"cmpConst" 0.02 0.70 0.00 0.00
"enumerate" 0.02 0.70 0.00 0.00
"fn" 0.02 0.70 0.00 0.00
"fun" 0.02 0.70 0.00 0.00
"namespaceImportFrom" 0.02 0.70 0.00 0.00
"Ops.numeric_version" 0.02 0.70 0.00 0.00
"packageHasNamespace" 0.02 0.70 0.00 0.00
"read.dcf" 0.02 0.70 0.00 0.00
"registerS3methods" 0.02 0.70 0.00 0.00
"seq" 0.02 0.70 0.00 0.00
"seq.default" 0.02 0.70 0.00 0.00
"setenv" 0.02 0.70 0.00 0.00
"simplify2array" 0.02 0.70 0.00 0.00
"split" 0.02 0.70 0.00 0.00
"structure" 0.02 0.70 0.00 0.00
"sys.function" 0.02 0.70 0.00 0.00
"utils::file_test" 0.02 0.70 0.00 0.00

$sample.interval
[1] 0.02

$sampling.time
[1] 2.84

0 Likes

#6

Can't find the file.

0 Likes

#7

This issue is still occurring. Now my RStudio throws errors saying "it's taking a long time do you want to terminate?" on startup.

0 Likes

#8

Looks like that trace didn't capture whatever might be going on; the R functions that were running took about ~2s in total. So something else is going on behind the scenes.

Other things worth trying:

  • Disable project indexing (see [ ] Index source files (for code search/navigation))

  • Disable the Packages pane (see [x] Enable packages pane)

  • Disable code diagnostics ([ ] Show diagnostics for R)

  • Disable Git / SVN integration ([ ] Enable version control interface for RStudio projects)

If none of these work for you then you'll have to provide more information on your environment -- your experience is not typical, and the most likely explanation is something unique about the environment in which you're running RStudio.

0 Likes

R Studio becomes exteremely slow after few days again and again
closed #9

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

0 Likes