Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

R studio is very slow (typing text lags) -- how to resolve? #354

Open
aramcb opened this issue Oct 4, 2016 · 53 comments
Open

R studio is very slow (typing text lags) -- how to resolve? #354

aramcb opened this issue Oct 4, 2016 · 53 comments

Comments

@aramcb
Copy link

aramcb commented Oct 4, 2016

Hello,

My R studio IDE lags extremely when typing text and this really makes it frustrating to code. Of note, the actual execution of code takes no time but the writing of code lags. This issue occurs regularly but not always. I have looked online to no avail for a solution. I have tried reinstalling R studio to no avail as well.

Does someone have a solution?? thx!

I do not believe it is an issue with my laptop which has sufficient specs to run this:

  • Windows 10 Pro
  • intel i7-465U CPU @1.70 GHz 2.30 GHz
  • 8 GB RAM
  • 64 bit processor

Aram

@RosieRedfield
Copy link

I'm having a similar problem. When I look back at what I've typed, I find characters or strings of characters missing, as if my typing speed (certainly not fast) was faster than the RStudio processing speed.

@jennybc
Copy link
Member

jennybc commented Oct 4, 2016

Hmmm .... I will ask someone on the inside about this.

@jennybc
Copy link
Member

jennybc commented Oct 4, 2016

@aramcb @RosieRedfield and anyone else experiencing this, can you share more specifics?

  • RStudio version number: get from RStudio > About RStudio
  • Type of document: R script, R Markdown, ???
  • Size of document: is it "small" or "large"? I'm guessing if it's for this class, it's quite "small".

@aramcb
Copy link
Author

aramcb commented Oct 5, 2016

Rstudio version
Version 1.0.28 – © 2009-2016 RStudio, Inc.
Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) rstudio Safari/538.1 Qt/5.4.1

R Markdown was the type and it was a class file so pretty small.

Thank you!

@kevinushey
Copy link

Some more potential culprits -- just trying to figure out a possible cause...

  1. Does the console have lots of output? Does clearing the console (with e.g. Ctrl + L) help?
  2. Does your laptop have a high DPI display, by any chance? If so, does lowering the resolution make a difference?
  3. Do you see this slowness in all documents, or only certain ones? (If you open a plain new .R document in the IDE, is editing sluggish there as well?)
  4. Do you have any other programs open that could be eating up memory?

Please let us know if you discover anything that affects the lagginess (whether it makes it worse, or better!)

@aramcb
Copy link
Author

aramcb commented Oct 5, 2016

Hi Kevin,

I have already tried clearing the console and history -- this doesn't seem to help.
I get lag when R Studio is the only program open.

I am not sure how to check if my laptop has a high DPI display BUT I will try running R studio with "disable display scaling on high DPI settings" using compatibility mode. I will let you know if this fixes it.

Thank you!
Aram

@RosieRedfield
Copy link

It's only happened a few times and I didn't pay attention to the circumstances (just fixed the text and went on). But I'm pretty sure one of the times was when I was typing notes in yesterday's class. This was in a small R or Rmd file, using the latest (preview) version of RStudio on an old macbook pro.

@kevinushey
Copy link

Thanks, everyone! And please let me know if you're able to discover a reproducible example -- once we have that, we'll have a much better chance of isolating + fixing the problem.

@samhinshaw
Copy link

Some potential fixes gathered from around the internet:

  1. Set zoom to 100% [Global Options] -> [Appearance] -> [Zoom]
  2. Disable Diagnostics in R [Global Options] -> [Code] -> [Diagnostics]

Other thoughts:

@aramcb
Copy link
Author

aramcb commented Oct 12, 2016

Just want to say that disabling "display scaling on high DPI settings" (by using compatibility mode -- via right-clicking R-studio shortcut) seemed to work for me.

This solution works in spite of me having zoom on (everything is too small otherwise).

Very happy with this.

Aram

@oganm
Copy link
Member

oganm commented Oct 12, 2016

Remember that you can set the font size from options

@kevinushey
Copy link

Awesome, glad to hear that resolves the issue @aramcb. We are still hopeful that newer versions of RStudio will come with a faster rendering engine that will ensure workarounds like this are no longer needed!

@aramcb
Copy link
Author

aramcb commented Oct 14, 2016

I just want to say that the issue has somewhat returned for me; what appears to help is clearing the saved history of commands every once in a while.

@aramcb
Copy link
Author

aramcb commented Oct 25, 2016

If someone has found a solution for this, please do share! The issue persists on my end. Still waiting :(

@aramcb
Copy link
Author

aramcb commented Nov 15, 2016

The lag appears to only occur on R Markdown docs. :(

@kevinushey
Copy link

@aramcb, some more things that might be worth checking:

  1. Does the lag depend on how large the editor window is? (Is there less lag when it's smaller?)
  2. Do you see this lag in all R Markdown documents, or just certain (e.g. large) ones?
  3. Is the lag worse near the start of the document, or end, or anything like that?
  4. Does the lag get worse over time, or is it always there and bad?
  5. Does disabling diagnostics make a difference? (Tools -> Global Options... -> Code -> Diagnostics; uncheck the 'Show Diagnostics for R' preference)
  6. Does disabling inline toolbars help? (Tools -> Global Options... -> R Markdown -> Show inline toolbar for R code chunks)

If you haven't already, can you try installing the latest daily build of RStudio and let us know if the issue is any better there? http://dailies.rstudio.com

Any extra information about things that make the lag better or worse will be helpful here -- thanks!

@aramcb
Copy link
Author

aramcb commented Nov 20, 2016

@kevinushey

Does the lag depend on how large the editor window is? (Is there less lag when it's smaller?)
The lag appears get worse the longer the .rmd document is but sometimes it sporadically disappears on .rmd which was previously lagging

Do you see this lag in all R Markdown documents, or just certain (e.g. large) ones?
Once the lag occurs it doesn't matter whether the .rmd is small or large (even if I restart R studio)

Is the lag worse near the start of the document, or end, or anything like that?
No difference where it is.

Does the lag get worse over time, or is it always there and bad?
It usually gets worse over time but sometime sporadically disappears .

Does disabling diagnostics make a difference? (Tools -> Global Options... -> Code -> Diagnostics; uncheck the 'Show Diagnostics for R' preference)
No difference when this is disabled

Does disabling inline toolbars help? (Tools -> Global Options... -> R Markdown -> Show inline toolbar for R code chunks)
No difference when this is disabled.

** restarting sometimes temporarily helps
Not sure if this is contributing to the problem, but I often see the line "Error: attempt to use zero-length variable name" in my console: I don't know why.

Thank you for any solution you may provide!

Best,
Aram

@kevinushey
Copy link

The lag appears get worse the longer the .rmd document is but sometimes it sporadically disappears on .rmd which was previously lagging

I'd love to hear if you can figure out what causes the lag to disappear -- one thing that sometimes helps is clearing the console (e.g. Ctrl + L); not sure if that's what you might've been doing?

Not sure if this is contributing to the problem, but I often see the line "Error: attempt to use zero-length variable name" in my console: I don't know why.

This could be triggered by the autocompletion system or something similar -- a way to reproduce this issue would be much appreciated!

@nathnx
Copy link

nathnx commented Sep 25, 2017

I just found out that windows 10 build 1703 causes the slow render text if the DPI value is over 100%. What I did is change back it 100% and restart the computer. Then, open up R studio and open .R that containing many text then close. After that, change DPI to any value you want then restart computer again.

@kevinushey
Copy link

That's very helpful to know -- thanks! We'll try testing as well to confirm whether this rings true on our side.

@aramcb
Copy link
Author

aramcb commented Sep 25, 2017

@NanXt how do you change the DPI value?

@kenarrow
Copy link

kenarrow commented Nov 2, 2017

Hi

I was facing exactly the same text lags as described in the previous postings. New computer

  • Windows 10 Pro
  • intel xeon e5-1650 CPU @3.60 GHz 3.60 GHz
  • 32 GB RAM
  • 64 bit processor
    and newest RStudio version 1.1.383.

Then I changed back to RStudio version 1.0.153 and the lagging disappeared.

@ahornero
Copy link

ahornero commented Nov 5, 2017

Hi,

Same issue here:

  • Windows 10 Pro
  • Retina display
  • RStudio 1.1.383

If I run RStudio overriding the HDPI scaling behaviour works fine. After trying all the suggestions, that's the only that works for me, although the quality of the IDE in terms of stylish/appearance is now worse.

image

I hope RStudio team could solve this soon. Thanks in advance.

@kevinushey
Copy link

We're currently working on updating the web rendering engine used by RStudio Desktop on Windows + Linux. This is a relatively large chunk of work but hope to have something testable by the end of the year.

@ahornero
Copy link

ahornero commented Nov 5, 2017

Hi Kevin,

Thanks in advance. I hope to have some news soon, I'm looking forward to this great update.

@egorananyev
Copy link

My two cents: I have a very fast machine, but the typing lag persists with all of the above recommendations (disabling diagnostics, overriding windows DPI settings, updating Rstudio, etc.)

  • Fresh .R script: no lag
  • Fresh .Rmd script: some lag
  • ~400 lines of code in .Rmd: sllooww
    What's worse is that I use vim mode, so relying on the keyboard responsiveness quite a lot.

@nathnx
Copy link

nathnx commented Dec 5, 2017

@aramcb you can find instruction here. I normally use 125%

@wlinInspire
Copy link

wlinInspire commented Dec 20, 2017

I have the same lagging problem with Rmarkdown.

@mattlowes
Copy link

mattlowes commented Dec 22, 2017

I'm having the same issue both with lags in typing and execution. I don't have an easily shareable reproducible example as they mostly come with longer, more involved .Rmd but I can try to make one. Some additional details:

  • Mac OS El Capitan v. 10.11.6
  • RStudio 1.1.331
  • Problem definitely most noticeable in .Rmd (I don't work often in just R scripts so I don't have as many examples.)
  • Problems most noticeable in longer .Rmd 400+ lines and severe in longer documents 700-1000+ lines.
  • I've tried all the above suggestions but seen little benefit. I'm not certain the Mac equivalent of adjusting the DPI settings so if anyone has a suggestion there let me know.

I enjoy RStudio but this definitely slows down my work. Thanks for the help!

@jennybc
Copy link
Member

jennybc commented Dec 22, 2017

My impression is that a definitive fix for this (on Mac) is in the works for early 2018.

@dmay8519
Copy link

dmay8519 commented Jan 21, 2018

Hi, just wondering if there is an update on the time frame for this fix. I have a number of projects on hold because of this issue, which has rendered my RStudio application unusable. I would like to continue with RStudio but will need to move to an alternative if a fix is not imminent. Thanks in advance for any advice you can provide. Cheers, Darren.

@jennybc
Copy link
Member

jennybc commented Jan 21, 2018

Maybe I should let @kevinushey summarize? But the main part of the work has happened, mostly by @kevinushey, in fact, but there's lots of loose ends and things to test. I bet he can give some info about when it will be available.

@dmay8519
Copy link

Hi all. I just installed the RStudio Desktop (Version 1.2.294) daily from https://dailies.rstudio.com, and this issue appears to be resolved. Happy days. I am running Win10 64-bit on a MacBook Pro (i7-5557U and Intel Iris Graphics 6100) via Bootcamp. I do not use Mac OS, so I cannot comment on whether the fix applies to the Mac daily also. My sincerest thanks to @kevinushey and the RStudio team for the fix, and to @jennybc for keeping us updated. Cheers, Darren.

@kevinushey
Copy link

Awesome! The daily builds are still somewhat unstable, so you may run into some strange issues here and there -- please let us know if you bump into anything at https://github.com/rstudio/rstudio/issues.

For anyone else who stumbles upon this thread, you can try downloading the latest daily builds of RStudio at https://dailies.rstudio.com, but please note that we just finished a migration of some internal machinery in the v1.2 builds and there is yet work to be done to buff out the rough edges.

@jaminday
Copy link

I stumbled across this thread... Probably not the right place but just adding a huge thankyou to @kevinushey and the team for the hard work on this. It was getting so frustrating working with .Rmd files (slow and laggy) I was at the point of using VS instead just so I could keep working (that or throw my laptop out a window). Installed the latest daily yesterday and now it's blazingly fast. Thanks again!

@Nzteb
Copy link

Nzteb commented Feb 16, 2018

Agree with the last post: Thank you for the attempt to fix this.
For me also the lag is very strong under version 1.1.423. The lag totally disappears under the daily version 1.2.349. Sadly, opening and saving files deletes all the content of the files in this version. I'm happy to wait for the official release.

@mattlowes
Copy link

mattlowes commented Feb 16, 2018 via email

@kevinushey
Copy link

@Nzteb: would you be willing to file this as a bug report at https://github.com/rstudio/rstudio/issues? We'd definitely like to fix that up before producing our official release! Some details on your system configuration would be helpful as I don't think we've had any reports of this thus far.

@kevinushey
Copy link

@mattlowes: currently the estimate is sometime in autumn; unfortunately we're still a little ways out. With some luck we may have a more stable build available as a preview release near the end of summer, though.

@Nzteb
Copy link

Nzteb commented Feb 20, 2018

@kevinushey I did it for the most recent daily version.

@cimentadaj
Copy link

@kevinushey my markdown document was very short and it was still very slow. I've used the Rstudio daily build and it's been working fine for the last 3 hours. Will report back if something changes.

Session info ------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.4 (2018-03-15)
 system   x86_64, mingw32             
 ui       RStudio (1.2.432)           
 language (EN)                        
 collate  English_United States.1252  
 tz       Europe/Paris                
 date     2018-03-19 

I'm currently using a Dell XPS 15 with Windows 10, fresh install.

@alexander8R
Copy link

I have been having some problems with Rstudio also. The only thing that seems to have helped is reverting from the standalone version to the one loaded through anaconda. Am I right in thinking there are subtle differences?

The things that I can comment on, ... when I run my code, among the values, there appears something like "gctorture = FALSE." (I think) I have tried most/all of the solutions that other people have tried. I also ran "open ~/.rstudio-desktop" and deleted all of the files contained therein, so to reset rstudio settings. I dont think my problem is to do with my operating system ,,,, but everything is heating up. I would really appreciate it if I could understand how to avoid this in the future?

@brianzhang01
Copy link

I was also experiencing lags for R notebooks on RStudio Desktop 1.1.383, Mac OS X 10.12.6. For me, what seemed to cause the lags was saving the notebook, as that triggered the HTML rendering which I believe is the slow part (kevinushey also referenced that the latest fix was in the HTML rendering).

I just tried out the Mac daily build 1.2.707 from https://dailies.rstudio.com/, but the problem persists. I thought this might be because the latest fix was only rolled out on Windows and Linux? Is there a timeline for a similar Mac implementation? Thanks.

@wlinInspire
Copy link

I have the lag issue, which I suspect to be due to my high resolution monitor (4K). I switched the Rstudio theme back to classic and the lag seems to be OK.

@kevinushey
Copy link

@brianzhang01 The latest v1.2 builds of RStudio should have the associated fixes for slowness on macOS as well. Any chance you can provide some more information on where you're observing this slowness? Can you provide a standalone sample notebook that is slow on your machine? Preferably something that I'd be able to run and play with on my own macOS machine if at all possible.

@brshallo
Copy link

brshallo commented Jul 30, 2018

@kevinushey I also have had issues working with .Rmd documents w/ git on Windows. I've noticed it affects:
1.) time it takes to render
2.) time it takes to open the preview browser (i.e. document will be rendered such that I could go and open the preview .html doc w/ Chrome or other browser, but RStudio browser will take a few minutes to open).
3.) Occassional lag or unresponsiveness when doing things like saving new files or opening existing files in RStudio

I'm on Windows 10. I just updated to git version 2.18.0.windows.1. I've run into this both with RStudio Desktop release 1.1.456 and with the daily build of RStudio 1.2.830. The issue seems to only be on projects where I have git set-up. I tried disabling security settings, overiding DPI scaling, maxing performance mode but issue seems to persist. The test file I've been using can be found here: https://raw.githubusercontent.com/brshallo/R4DS_Solutions/master/ch24.Rmd .

@kevinushey
Copy link

This sounds different from the 'laggy typing' sorts of issues that have been discussed otherwise in this thread. It seems more that RStudio is hanging while performing certain actions (e.g. perhaps while running Git in the background).

Can you file an issue on https://github.com/rstudio/rstudio/issues just so this doesn't get lost?

@scriscio
Copy link

scriscio commented Nov 2, 2018

Ok, So I was having this issue and oddly it was related to size of Rmd file. I tried many of the suggestions in this thread. The biggest improvement I have found so far is by switching to windows 7 compatibility mode. Also trying to reduce size of Rmd file (possibly by splitting the task into multiple Rmd scripts).

For me many of the settings either in app or DPI adjustments did not help.

@egorananyev
Copy link

Just wanted to bump this again: The issue persists despite implementing any of the offered recommendations. Would be great to see some action to resolve this.

@kevinushey
Copy link

@egorananyev to confirm, have you tried the latest preview release? If the issue still persists, please file an issue.

@egorananyev
Copy link

Yes, just tried it. It's indeed much faster!

@itaysisso
Copy link

Hallelujah!
Man, this was bugging me for so long... Even data frame views open up much faster now. This is awesome!

@omadav
Copy link

omadav commented Mar 7, 2019

Beautiful! I installed the latest preview release as suggested by @kevinushey and my RMarkdown doc is nice and smooth for the first time. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests