R / RStudio痛苦缓慢

时间:2019-03-20 23:32:48

标签: r performance rstudio startup

在过去的几个月中,由于启动时间长和性能高,R和RStudio几乎无法使用。当我在公司的VPN上工作时,这个问题一直存在。但是,无论我如何连接(没有VPN,没有VPN,直接连接到办公室以太网),这都成为一个问题。我曾见过其他人抱怨RStudio在使用VPN时运行缓慢,但是无论连接到我如何,RStudio和RGui都存在此问题。

我在StackOverflow(Rstudio is painfully slow)上找到了类似的链接,该链接可以通过运行gctorture(FALSE)来解决;但是,这并没有改善我的处境。我还研究了RStudio社区中的所有线程(最相关的是https://community.rstudio.com/t/rstudio-slow-response-over-vpn/6225),但是海报的问题似乎都不符合我的问题。

一些有关操作速度如何的参考点:加载RStudio可能需要5-7分钟以上的时间(在此期间,我盯着空白的空白屏幕),而运行library(tidyverse)则需要7-10分钟。加载RGui不会花费很长时间,但是再次运行library(tidyverse)则需要7-10分钟。

我不确定知道哪些其他信息会有用,但是我什至不知道如何独自进一步调查这个问题。我尝试取消/重新安装R和RStudio。我尝试过重置RStudio的状态(https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State)。我尝试全局更改工作目录,以始终引用R库的本地路径/文件夹,以避免遍历公司的OneDrive网络。什么都没有。

运行sessionInfo()返回:

>sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 10 x64 (build 15063)

Matrix products: default

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

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

other attached packages:
 [1] data.table_1.12.0 forcats_0.3.0     stringr_1.4.0     dplyr_0.8.0.1    
 [5] purrr_0.3.0       readr_1.3.1       tidyr_0.8.2       tibble_2.0.1     
 [9] ggplot2_3.1.0     tidyverse_1.2.1  

loaded via a namespace (and not attached):
 [1] withr_2.1.2      rvest_0.3.2      tidyselect_0.2.5 lattice_0.20-38 
 [5] pkgconfig_2.0.2  xml2_1.2.0       compiler_3.5.3   readxl_1.2.0    
 [9] Rcpp_1.0.0       cli_1.0.1        plyr_1.8.4       cellranger_1.1.0
[13] httr_1.4.0       tools_3.5.3      nlme_3.1-137     broom_0.5.1     
[17] R6_2.4.0         scales_1.0.0     assertthat_0.2.0 gtable_0.2.0    
[21] stringi_1.3.1    rstudioapi_0.9.0 backports_1.1.3  hms_0.4.2       
[25] munsell_0.5.0    grid_3.5.3       colorspace_1.4-0 glue_1.3.0      
[29] lubridate_1.7.4  rlang_0.3.1      magrittr_1.5     generics_0.0.2  
[33] lazyeval_0.2.1   crayon_1.3.4     haven_2.0.0      modelr_0.1.3    
[37] pillar_1.3.1     jsonlite_1.6

Sys.getenv()返回:

>Sys.getenv()
ALLUSERSPROFILE         C:\ProgramData
APPDATA                 C:\Users\combsd\AppData\Roaming
CommonProgramFiles      C:\Program Files (x86)\Common Files
CommonProgramFiles(x86)
                        C:\Program Files (x86)\Common Files
CommonProgramW6432      C:\Program Files\Common Files
COMPUTERNAME            ELSPHIL-7013101
ComSpec                 C:\WINDOWS\system32\cmd.exe
GFORTRAN_STDERR_UNIT    -1
GFORTRAN_STDOUT_UNIT    -1
HOME                    \\ELSPHIDATP04VA\COMBSD
HOMEDRIVE               C:
HOMEPATH                \Users\combsd
LOCALAPPDATA            C:\Users\combsd\AppData\Local
LOGONSERVER             \\ELSPHIDCXP021
MSYS2_ENV_CONV_EXCL     R_ARCH
NUMBER_OF_PROCESSORS    4
OneDrive                C:\Users\combsd\OneDrive - [Redacted Employer Name]
OneDriveCommercial      C:\Users\combsd\OneDrive - [Redacted Employer Name]
OS                      Windows_NT
PATH                    C:\Rtools\bin;C:\Program Files (x86)\Common
                        Files\Oracle\Java\javapath;C:\Rtools\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
                        Files\Microsoft SQL Server\Client
                        SDK\ODBC\130\Tools\Binn\;C:\Program Files
                        (x86)\Microsoft SQL
                        Server\140\Tools\Binn\;C:\Program
                        Files\Microsoft SQL
                        Server\140\Tools\Binn\;C:\Program
                        Files\Microsoft SQL
                        Server\140\DTS\Binn\;C:\Program Files
                        (x86)\Microsoft SQL Server\Client
                        SDK\ODBC\130\Tools\Binn\;C:\Program Files
                        (x86)\Microsoft SQL
                        Server\140\DTS\Binn\;C:\Program Files
                        (x86)\Microsoft SQL
                        Server\140\Tools\Binn\ManagementStudio\;C:\Program
                        Files\EasyFrom Inc\;C:\Program
                        Files\nodejs\;C:\Program
                        Files\Git\cmd;C:\Users\combsd\AppData\Local\Microsoft\WindowsApps;C:\Users\combsd\AppData\Local\Programs\MiKTeX
                        2.9\miktex\bin\x64\;C:\Users\combsd\AppData\Roaming\npm;C:\Users\combsd\AppData\Local\Programs\Microsoft
                        VS Code\bin;C:\Program
                        Files\heroku\bin;C:\Users\combsd\AppData\Local\GitHubDesktop\bin
PATHEXT                 .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE
                        x86
PROCESSOR_ARCHITEW6432
                        AMD64
PROCESSOR_IDENTIFIER    Intel64 Family 6 Model 142 Stepping 9,
                        GenuineIntel
PROCESSOR_LEVEL         6
PROCESSOR_REVISION      8e09
ProgramData             C:\ProgramData
ProgramFiles            C:\Program Files (x86)
ProgramFiles(x86)       C:\Program Files (x86)
ProgramW6432            C:\Program Files
PSModulePath            C:\Program
                        Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program
                        Files (x86)\Microsoft SQL
                        Server\140\Tools\PowerShell\Modules\
PUBLIC                  C:\Users\Public
R_ARCH                  /i386
R_COMPILED_BY           gcc 4.9.3
R_HOME                  C:/PROGRA~1/R/R-35~1.3
R_LIBS_USER             \\ELSPHIDATP04VA\COMBSD/R/win-library/3.5
R_USER                  \\ELSPHIDATP04VA\COMBSD
SESSIONNAME             Console
snow_agent              C:\Program Files\Snow Software\Inventory\Agent
SystemDrive             C:
SystemRoot              C:\WINDOWS
TEMP                    C:\Users\combsd\AppData\Local\Temp
TMP                     C:\Users\combsd\AppData\Local\Temp
UATDATA                 C:\WINDOWS\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
USERDNSDOMAIN           SCIENCE.[Redacted Employer Name].NET
USERDOMAIN              SCIENCE
USERDOMAIN_ROAMINGPROFILE
                        SCIENCE
USERNAME                combsd
USERPROFILE             C:\Users\combsd
windir                  C:\WINDOWS

任何支持都将不胜感激。我很乐意回答问题/提供更多信息,但是目前我不知道该去哪里。

1 个答案:

答案 0 :(得分:1)

我认为这个问题最好在https://community.rstudio.com/c/rstudio-ide接受,因为Stack Overflow通常不适用于需要额外来回发现问题根源的问题。

一些可能相关的线程:

https://community.rstudio.com/t/exceptionally-slow-to-open-rstudio-and-package-manager/20810/2

https://community.rstudio.com/t/rstudio-1-1-383-issue-on-startup/1819/15

我还建议您检查preview release