Skip to content

RStudio very slow when running code from markdown (rmd) in projects on network drives #8034

Closed

Description

@BurninLeo

This problem has been reported several times in the RStudio Community: When working with a project that is located on a network drive (Windows default net use), RStudio becomes painfully slow.

The problem does not occur in network-located projects per se. When runing code in the console, that is fast. But as soon as the code is in a markdown editor (rmd file) and runs from there, there seems to be an issue with output caching. Even code that only defines functions is executed slow.

Knitting the rmd to HTML or PDF works fast and without problems, therefore this seems a issue with the markdown editor.

Network connection: Download 12.30 Mbit/s, Upload 12.08 Mbit/s, Ping 38.76 ms, Jitter 32.34 ms

System details

RStudio Edition : Desktop
RStudio Version : 1.3.1073
OS Version      : Windows 10 (x86_64-w64-mingw32)
R Version       : 4.0.2 (2020-06-22)

Steps to reproduce the problem

  1. Map a network drive under Windows 10 (e.g., from a Windows Fileserver)
  2. Create a new RStudio project on that network drive
  3. Create a new markdown (rmd) file in RStudio and save it (in the project)
  4. Add code sections to the markdown
  5. Run the code within the markdown editor (so that the output appears in the editor)

Describe the problem in detail

The output is extremely slow. Made a video to visualize the issue:
https://drive.google.com/file/d/1oZCJuMotypRJ846jlfkNO4NTYYFlQ4Pt/view?usp=sharing
(yes, this is really realtime)

Describe the behavior you expected

The code should run similarly fast as in the console.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • [n/a] If I am reporting a RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. stale commented on Feb 4, 2021

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

  2. added
    stale
    on Feb 4, 2021
  3. BurninLeo commented on Feb 5, 2021

    @BurninLeo
    Author

    unstale ... the issue still persists in RStudio 1.14.1103

  4. removed
    stale
    on Feb 5, 2021
  5. emjonaitis commented on Feb 12, 2021

    @emjonaitis

    Seconding that this is not a stale issue. RStudio has become nearly unusable for me.

  6. scebbers commented on Aug 26, 2021

    @scebbers

    True for me as well!

  7. lukepc commented on Nov 5, 2021

    @lukepc

    Still the case for me, running 2021.09.0 Build 351.

  8. HEHenson commented on Nov 21, 2021

    @HEHenson

    Yes, I will add to this, as I would not want this issue to go stale. I am working with an up-to-date version in November of 2021. For me, it appears to be associated with importing Kable graphics with a lot of options set. The best solution that I can come up with is to turn of the refresh automatically option on the Environment Window that comes up when editing the RMD file.

  9. 28 remaining items

  10. self-assigned this
    on Sep 20, 2023
  11. LafontRapnouilTristan commented on Sep 21, 2023

    @LafontRapnouilTristan

    Hi,

    I don't know if it helps as I'm not at all well versed in the arts of computer sciences but I have noticed that when I splitted my Rmarkdown files in several .Rmd instead of having one long file it seemed to greatly reduce the problem.

    I have no idea how to prove or test rigorously for this but if it makes sens for someone I won't regret this post.

    Thanks for investigating this issue and have a great day!
    Cheers

  12. ivanlambert1975 commented on Sep 21, 2023

    @ivanlambert1975

    Good Afternoon,

    thanks @kevinushey and @LafontRapnouilTristan. I now develop Quarto published documents entirely on local drive, instead of network file share. This is working well.

    Following your observations, @LafontRapnouilTristan I've just now tested if slow down occurs on my setup when using network drive with both large (700 lines over 40 chunks) and smaller (100 lines with 3 chunks). I can confirm that for my situation, the dramatic slow down in Quarto document preview occurs in both small and large qmd documents, only when the project and qmd files reside on a Microsoft Window's file server.

    Small qmd and large exhibit this slow behaviour consistently on my platform and Quarto version shown below.

    My test chunk consisted of a call to a function to render a leaflet map (htmlwidget) with 7 layers. Switching to "Visual" to get preview:

    TEST 1: If qmd and project is stored locally on laptop, this renders in under 1 second reliably. (my baseline)
    TEST 2: If qmd (part of qmd containing 3 chunks) and project is stored on Windows file server, this same leaflet map in a single chunk renders very slowly in 1 minute 2 seconds (my 1st comparison)
    TEST 3: If qmd (part of qmd containing 40 chunks) and project is stored on Windows file server, this same leaflet map in a single chunk renders slowly in 1 minute 4 seconds (my 2nd comparison)

    Something is slowing down Quarto's Preview in R Studio by a factor of roughly 60 when R project and qmd are on Microsoft Windows file share. Thanks for investigating the possible cause @kevinushey.
    I don't have any slow down of execution outside of the Quarto "Visual" preview.
    Leaflet maps render to the R Studio Viewer from chunk in under 1 second.

    Locally, for the large test I can render all 40 chunks (each contains a htmlwidget such as leaflet map) to a complex html document in under a minute, but only if it's locally stored.

    Quick solution/ workaround? Work locally. Synch your code to github and sometimes backup to Windows file share.
    I hope this helps someone - because when it's running quickly, Quarto makes very impressive and flexible documents.

    RStudio 2023.06.2+561 "Mountain Hydrangea" Release (de44a31, 2023-08-25) for windows
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.06.2+561 Chrome/110.0.5481.208 Electron/23.3.0 Safari/537.36

    quarto_version()
    [1] ‘1.3.450’

  13. kevinushey commented on Sep 22, 2023

    @kevinushey
    Collaborator

    I've just merged a potential fix for this issue -- if all goes well, the next daily builds should be ready for testing.

  14. kevinushey commented on Sep 25, 2023

    @kevinushey
    Collaborator

    Daily builds are up at https://dailies.rstudio.com/ -- would anyone experiencing this issue be willing to download a recent daily build of RStudio and let us know if the issue still persists?

  15. ivanlambert1975 commented on Sep 25, 2023

    @ivanlambert1975
  16. olivroy commented on Sep 25, 2023

    @olivroy
  17. ivanlambert1975 commented on Sep 25, 2023

    @ivanlambert1975
  18. kevinushey commented on Sep 25, 2023

    @kevinushey
    Collaborator

    Thanks @ivanlambert1975 -- sorry, I should have been more specific; the fix is in the daily builds for Ocean Storm. Those Windows builds are available here:

    https://dailies.rstudio.com/rstudio/ocean-storm/electron/windows/

  19. ivanlambert1975 commented on Oct 3, 2023

    @ivanlambert1975
  20. kevinushey commented on Oct 3, 2023

    @kevinushey
    Collaborator

    Thank you @ivanlambert1975 -- it's great to hear the speed issues appear to be resolved!

    However, again as above, I couldn’t get the htmlwidgets to render inline in chunks within Visual.

    Would you be willing to file a new issue, capturing this particular issue? We can try to take a look at this as well.

  21. ronblum commented on Oct 18, 2023

    @ronblum
    Contributor

    Marking as fixed based on the verification above.

  22. rfbrondum commented on Dec 21, 2023

    @rfbrondum

    I seem to have a similar problem with Rmarkdown documents after upgrading to Rstudio 2023.12.0-369 - had no problem before the update.

  23. kevinushey commented on Dec 27, 2023

    @kevinushey
    Collaborator

    @rfbrondum can you please file a new issue with more details on what exactly you're seeing / experiencing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugr markdownremote storage

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions