RStudio suddenly slow processing


#21

The project lives on a network drive, though a colleague has tested using projects located on a local drive and the issue persists. RStudio Desktop is installed locally. The setup was identical before the upgrade to windows 10 but there were no issues regarding delays of commands with version 1.1.442. I have been monitoring these logs a bit (since you pointed me to them) and sometimes the bars get really long (they won't fit on the screen anymore).
Working with files instead of projects shows no signs of delays and everything works as expected. Given that we have usually multiple people working on the same project, a project based workflow is pretty much essential for reproducibility etc. so we would really like to avoid file based workflow.


#22

Any chance you can try the RStudio daily builds and let us know if the situation is at all improved there? https://dailies.rstudio.com

Does it make a difference if you disable project indexing for that project? See in Tools -> Project Options... -> Code Editing; try disabling [ ] Index source files (for code search/navigation):

Is there by any chance a specific set of actions that reproduces this slowness, or does it just seem to come on intermittently?


#23

With the following code as a single file in a test project on a network drive I see the attached behaviour. The zip file contains screenshots of the event logs with/without indexing for RStudio versions 1.2.516 (daily) and 1.1.442 when each line is run separately by pressing Ctrl+Enter. I also included screenshots for running all commands at once Ctrl+a -> Ctrl+Enter ('_ctrl_a' in file name). Additionally, I included a screencast of the behaviour when running line by line in version 1.1.442 (ndexing turned off).

library(dplyr)

data(iris)

summary(iris)

plot(Sepal.Length ~ Sepal.Width, data = iris)
boxplot(Sepal.Length ~ Species, data = iris)

iris_mean = iris %>%
  group_by(Species) %>%
  summarise(sep_w = mean(Sepal.Width, na.rm = TRUE),
            sep_l = mean(Sepal.Length, na.rm = TRUE))

iris_mean

It seems that turning off indexing does help a little, but is still far from performing well. As you can see from the screencast, it is only every other command that takes a long time.

I must correct my previous statement that running projects locally exhibits the same behaviour. I tested myself today and did not encounter any slowness (project located on C:/ drive). So it seems that this is only affecting projects on network drives. Still, I am wondering what changed between versions 0.9xxx and 1.1xxx and also between windows 7 and windows 10.

I see that I cannot attach a zip file. Can you provide an email address to which I could send it?


#24

Thanks for the update! Just to summarize, it appears that the issue here is that RStudio v1.1 and v1.2 are much slower when interacting with a network filesystem, compared to RStudio v0.99. Is that correct?

RStudio does attempt to save a lot of metadata into the folder called .Rproj.user located within the project's directory, and RStudio does save some state more eagerly in v1.1 and v1.2. I wonder if that could be the cause here?

That said, I'm still perplexed as to what the underlying issue might be in your case. We'll have to try and see if we can replicate a similar environment and reproduce the slowness you're seeing. Can you share any other details as to what kind of network filesystem you're using?


#25
  1. yes, that's correct.

  2. the .Rproj.user folder for a particular project that exhibits slowness has a total size of 426KB. I guess that shouldn't be a problem.

  3. We're behind a proxy. Some screenshots with details on the network and personal laptop below.

Network:
Unbenannt

Local laptop:
Unbenannt2

Did you get my email with the recording?


#26

I had the same issue as others---Rstudio became extremely slow. Adding that list of processes (Rterm.exe, rsession.exe, rstudio.exe, git.exe) to the list of Windows Defenders Exclusions as explained here solved the problem. But I did not exclude all those file types, since that had no impact and seems unsafe. Thanks!


#27

Sorry for taking so long to respond -- I was out of office last month. I did receive your e-mail; here's my best guess from what I see.

In RStudio v1.2, we now attempt to synchronize document-related state a bit more eagerly. In particular, we try to synchronize the cursor position whenever the cursor is moved and the IDE is 'idle' for a couple seconds. It seems like those attempts to synchronize state are very slow in your environment.

Unfortunately, this behavior currently cannot be toggled. I'll add this as a feature request since we should have that anyhow; and with that we'll be able to see if that truly is the culprit in your case.


#28

Thanks for confirming! I'd be curious to know whether this is relevant in @timsalabim's environment as well.


#29

Thanks for getting back @kevinushey ! I'll update the thread regarding exceptions in McAffe (in our case) once our IT department manages to implement them... They are slow!


#30

@timsalabim, it's now possible to toggle the cursor save / load behavior in the latest daily builds of RStudio (v1.2.631), available at:

https://dailies.rstudio.com/

See the option [ ] Restore last cursor position when opening file:

If possible, can you see if disabling that makes any difference in your environment?


#31

@kevinushey I am really sorry that I cannot test this new toggle anymore, as coincidentally our IT department has implemented my request of defining the above mentioned .exe files as exceptions for the McAffee scanner at the same time and I don't want to ask them to revert it for testing purposes :slight_smile:. On the upside this did indeed fix the issue on our system.
Thanks for all the patience and help you provided over the last weeks and keep up the good work. I am happy we could pin this down (at least on our side).
I am really looking forward to the release of 1.2 as I hear it has more nice improvements.


#32

No problem; I'm glad you were able to get to the bottom of it!


#33

Was having the horrible slowdown after installing devtools. installing the latest daily worked for me, thanks.


#34

The dailies fix helped me. I'm on CentOS 7 working from a network drive mounted using sshfs. The project folder is also a git repository.

I unchecked the box and everything is smooth as butter now. Thanks!


#35

Funnily enough, after I sent this reply, I noticed the behavior that leads to a slowdown again.

Submitting a command from a Rmd file (ctrl+enter) leads to really slow output in the console.

Copying a command from the Rmd file and pasting it in the console leads to fast output.

Is there any reason why this would be?


#36

For a long time this happened to me and I couldn't understand why. The longer you work, the slower RStudio becomes. The answer (at least for me) is the console window. It seems, at least on a Windows 10 machine, that a build up of analysis in the console results in very sluggish behavior. Hitting CNTR + L clears the console and the sluggishness is gone. That's why people restarting RStudio or installing new builds seemed to help but restarting R did not. The former things clear the console while the later does not, though the former techniques only temporarily alleviate the issue. So to recap CNTR + L for the win!


#37

Thanks. CTRL + L didn't help me in this case. Maybe I should start a new ticket.

Here is the behavior. 1.5m of waiting for the console to fill up, but copy + paste is nearly instant.


#38

Hi,

I am having the same issue here. It started a few days ago, and my R studio is extremely slow, mostly working with project. It takes a long time just to create a new project, for example. I have already uninstalled and installed R and R studio and it didnt improve much. I am not using git in any of this projects, R is installed locally, and I had a windows 10 upgrade a few days ago, but I have already reverted to the old version. My sessioninfo() below. Any idea what can be slowing down my Rstudio?

R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

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.0 tools_3.5.0


#39

2 posts were split to a new topic: Knitting the ioslides presentation is painfully slow - network drive


#40

Thanks! Hidden folders were causing my projects to run extremely slow.