Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Knitting to html sluggish when in an RStudio project under version control #1304

Closed
Chris-Engelhardt opened this issue Mar 27, 2018 · 11 comments
Assignees
Labels
bug an unexpected problem or unintended behavior

Comments

@Chris-Engelhardt
Copy link

I have an RStudio project under version control. In this project is an .Rmd file that, when knit, is very sluggish to render. If I attempt to knit the same .Rmd file in a project not under version control, the sluggishness is no longer observed. I also do not observe a slow down when a new project is created and all files from the project under version control are copied to the new project not under version control. Any ideas on the possible cause?

devtools::session_info()
Session info --------------------------------------------------------------
setting value
version R version 3.3.3 (2017-03-06)
system x86_64, mingw32
ui RStudio (1.1.442)
language (EN)
collate English_United States.1252
tz America/Chicago
date 2018-03-27

Packages ------------------------------------------------------------------
package * version date source
backports 1.1.2 2017-12-13 CRAN (R 3.3.3)
base * 3.3.3 2017-03-06 local
datasets * 3.3.3 2017-03-06 local
devtools 1.13.4 2017-11-09 CRAN (R 3.3.3)
digest 0.6.14 2018-01-14 CRAN (R 3.3.3)
evaluate 0.10.1 2017-06-24 CRAN (R 3.3.3)
graphics * 3.3.3 2017-03-06 local
grDevices * 3.3.3 2017-03-06 local
htmltools 0.3.6 2017-04-28 CRAN (R 3.3.3)
knitr * 1.20 2018-02-20 CRAN (R 3.3.3)
magrittr 1.5 2014-11-22 CRAN (R 3.3.3)
memoise 1.0.0 2016-01-29 CRAN (R 3.3.3)
methods * 3.3.3 2017-03-06 local
Rcpp 0.12.15 2018-01-20 CRAN (R 3.3.3)
rmarkdown * 1.9 2018-03-01 CRAN (R 3.3.3)
rprojroot 1.3-2 2018-01-03 CRAN (R 3.3.3)
rstudioapi 0.7 2017-09-07 CRAN (R 3.3.3)
stats * 3.3.3 2017-03-06 local
stringi 1.1.6 2017-11-17 CRAN (R 3.3.3)
stringr 1.3.0 2018-02-19 CRAN (R 3.3.3)
tools 3.3.3 2017-03-06 local
utils * 3.3.3 2017-03-06 local
withr 2.1.1.9000 2018-01-29 Github (r-lib/withr@df18523)
yaml 2.1.18 2018-03-08 CRAN (R 3.3.3)

@rich-iannone rich-iannone self-assigned this Mar 27, 2018
@rich-iannone rich-iannone added bug an unexpected problem or unintended behavior Difficulty: Intermediate labels Mar 27, 2018
@yihui
Copy link
Member

yihui commented Mar 28, 2018

@rich-iannone If this is reproducible to you, I believe the rstudio/rstudio repo is the right place to file this issue. I doubt there is anything we could do for this in the rmarkdown package.

@Chris-Engelhardt
Copy link
Author

Chris-Engelhardt commented Mar 28, 2018

We reproduced the issue on a screen share, so I'm hopeful that @rich-iannone can produce it on his own.

@rich-iannone
Copy link
Member

@yihui I will ensure this is reproducible (unclear whether this is Windows only, or, is seen on the other platforms). I can file it in the other repo shortly with some testing notes.

@Chris-Engelhardt
Copy link
Author

Thanks, @rich-iannone

@yihui
Copy link
Member

yihui commented Mar 28, 2018

It will be great if you could test an RStudio daily build (https://dailies.rstudio.com/), because I suspect this is the same issue as rstudio/rstudio#2141, which has been fixed last month.

@rich-iannone
Copy link
Member

I'll test a daily build (I'm on 1.2.407) and also the Preview Release (v1.1.442). I'll provide notes here.

@rich-iannone
Copy link
Member

rich-iannone commented Mar 28, 2018

Did some testing with Windows 10 Enterprise Edition (VMware image) with RStudio Preview Release (v1.1.442). Installed git from git-scm.com (version 2.16.2 for Windows). From the clean R install of 3.4.4, I installed the tidyverse packages and any packages required to render .Rmd (installed by RStudio upon pressing Knit).

I made 2 projects with a large collection of .Rmd files and supporting assets. One had version control enabled, and the other did not. I tested the rendering of the same .Rmd file in both projects. There was no apparent change.

I then did an 'unhide' of the .git folder, hoping to reproduce the lag that you and others have experienced. Interestingly, I didn't observe a lag at all. There could be a few reasons for this, perhaps a Windows filesystem difference (I have a very recent build of Windows and maybe a different version than others) or it might be the file-locking/race-condition is less of an issue with a newer version of Git.

My suggestion @Chris-Engelhardt is to try a daily build of RStudio with your project and perform these tests. As @yihui mentioned, the similar issue rstudio/rstudio#2141 has been recently addressed (even as recent as yesterday). If you can report the results with the daily build here, that would be appreciated. Furthermore, you could always go back to the Preview build if there are other issues with the daily that you don't want to deal with.

@jmcphers
Copy link
Member

FWIW, you no longer need to use the unstable channel to get a fix for the .git issue; we just published a preview release which has a fix for the .git folder issue specifically.

https://www.rstudio.com/products/rstudio/download/preview/

@Chris-Engelhardt
Copy link
Author

@rich-iannone and @jmcphers -- I installed newer versions of R, git, the preview version of RStudio, and the daily build of RStudio, with a knit test following each new install. None of these changes resolved the problem completely, though I did observe some modest improvement in speed (rendered display now appears in 5s rather than 10s).

@Chris-Engelhardt
Copy link
Author

Chris-Engelhardt commented Apr 2, 2018

After my tests above failed, I committed and pushed all files in the RStudio project to my remote repository. Once I did that, the sluggishness in rendering disappeared and performs similarly to rendering in a project not under version control.

The total size of the project is 35 MB, 24 MB of which is located in a folder where the rmarkdown documents are stored. I don't yet fully understand the source of the problem (e.g., size of uncommitted files, race conditions, etc.), but the problem itself seems to be fixed.

The problem also does not exist on the preview release of RStudio, nor does it it exist on the stable release.

Thanks for taking time to help! Much appreciated.

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants