eco-data-science / eco-data-science-old-site

website, wiki and issues for the group
http://eco-data-science.github.io
Other
31 stars 18 forks source link

R Studio slow when project is part of a git repo? #39

Closed jcvdav closed 7 years ago

jcvdav commented 7 years ago

Hey guys,

Has anyone encountered that R Studio and Git Bash run extremely slow when inside a repo?

A couple of days ago I started having a terribly slow behaviour on R Studio. Simple operations such as 2 + 2 can take about 10 - 20 seconds to perform. I am sure it is not my computer, because running system.time(2+2) gives me

   user  system elapsed 
      0       0       0

Opening or switching projects and opening, saving or closing files also takes about 15 seconds. Yet, if I switch to a project that is not within a git repo everything runs smoothly. If I try to run anything from the Git Bash, like git status or git commit -a -m "message", will also take a couple of seconds. Everything else in my computer works just fine. I do not get slow styping / scrolling, like it has been reported some other times.

After poking around, I have found a couple of partial fixes. I have a problem similar to the one here. Running gc() and / or gctorture(on = F) on R, or git gc in the cmd seems to help. However, as soon as I save any file, or modify an object in the Environment, everything becomes slow again. Running these commands again sometimes help, but is not a sure thing.

Some other things I have tried:

I think R Studio runs git status to update the part that lets you stage files: image

Has anybody run into this problem and found a fix? Working with this slowness is very difficult and frustrating.

HELP!

DanOvando commented 7 years ago

@jcvdav, Not the most scientific response, but I've I've run into this sometimes when git is trying to track .html objects, or very large files (e.g. a .dbf). I've fixed it by just ignoring those files.

oharac commented 7 years ago

Following up on @DanOvando 's suggestion, maybe try BFG repo cleaner to tidy up the repo? I'd committed some large-ish files and then moved them out of Git later, but Git still tracked them, which made it slow to clone the repo into a new project (and perhaps slows the communication between R Studio and Git?). BFG removes any not-current large files from the tracked Git objects and seemed to help in my case.

jcvdav commented 7 years ago

Looks like adding a couple *.dbf files I had to git.ignore helped a bit, but is wasn't quite there yet. I then ran BFG and saw no changes in speed, although I am sure its all nice and tidy now!

I created a new repo, cloned it and experienced the same lag. The repo only had the README.md file. I have no idea what is causing this. I will uninstall everything and install it again, although I updated everything and saw no change.

I will keep reading and searching for options, and if I come across a solution will post it here

DanOvando commented 7 years ago

Weird! Let us know

Dan

On Wed, Jul 19, 2017 at 10:28 AM, Juan Carlos Villaseñor-Derbez < notifications@github.com> wrote:

Looks like adding a couple *.dbf files I had to git.ignore helped a bit, but is wasn't quite there yet. I then ran BFG and saw no changes in speed, although I am sure its all nice and tidy now!

I created a new repo, cloned it and experienced the same lag. The repo only had the README.md file. I have no idea what is causing this. I will uninstall everything and install it again, although I updated everything and saw no change.

I will keep reading and searching for options, and if I come across a solution will post it here

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eco-data-science/eco-data-science.github.io/issues/39#issuecomment-316459422, or mute the thread https://github.com/notifications/unsubscribe-auth/AHuJt2KTRtNuhB-BByUDYkoQqILWpKbMks5sPjzYgaJpZM4OZfC4 .

-- PhD Candidate, Project Researcher Sustainable Fisheries Group University of California, Santa Barbara

grantmcdermott commented 7 years ago

Not an immediate solution, but a wider suggestion: Try a dual boot! https://www.tecmint.com/install-ubuntu-16-04-alongside-with-windows-10-or-8-in-dual-boot/

You'll have the safety and fallback of Windows if you need it (you won't), but the native capability and benefits of a nix system from now on. Inbuilt bash and git, much* better parallel processing for R and other programs, and a long, long list of other benefits :)

jcvdav commented 7 years ago

Fixed it!

After cloning the empty repo I knew this had to be just a git problem. I went trhough many of the issues on github for git for windows (git-ception?) and found that the graphics drivers might be the problem here and here.

I disabeled the AMD Radeon R7 M460 driver and switched to the Intel HD Graphics 620 and boom! Fast as normal!

I know it sounds weird, and some people also thought that, and this was the answer:

From

Okay. That problem is very weird. I looked into your suggestions, and updated the graphic drivers. After several attempts, restarts and versions, I finally got it to work properly. However, why is this happening? It's only a shell programm, not a 2D or 3D one!

From PhilipOakly

... But all of the graphic (terminal) output has to be displayed via those drivers. They (the drivers) get their hooks into all parts of the system with hidden interupts and time outs and goodness knows what. Shudders...

So... closed!

And @grantmcdermott I will look into that, thanks.

DanOvando commented 7 years ago

well I can certainly say the graphics driver would have been the last place I would have looked... weird!

On Wed, Jul 19, 2017 at 1:13 PM, Juan Carlos Villaseñor-Derbez < notifications@github.com> wrote:

Fixed it!

After cloning the empty repo I knew this had to be just a git problem. I went trhough many of the issues on github for git for windows https://github.com/git-for-windows/git (git-ception?) and found that the graphics drivers might be the problem here https://github.com/git-for-windows/git/issues/1070 and here https://github.com/git-for-windows/git/issues/1129.

I disabeled the AMD Radeon R7 M460 driver and switched to the Intel HD Graphics 620 and boom! Fast as normal!

I know it sounds weird, and some people also thought that, and this was the answer:

From https://github.com/vocaviking

Okay. That problem is very weird. I looked into your suggestions, and updated the graphic drivers. After several attempts, restarts and versions, I finally got it to work properly. However, why is this happening? It's only a shell programm, not a 2D or 3D one!

From PhilipOakly https://github.com/PhilipOakley

... But all of the graphic (terminal) output has to be displayed via those drivers. They (the drivers) get their hooks into all parts of the system with hidden interupts and time outs and goodness knows what. Shudders...

So... closed!

And @grantmcdermott https://github.com/grantmcdermott I will look into that, thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eco-data-science/eco-data-science.github.io/issues/39#issuecomment-316503054, or mute the thread https://github.com/notifications/unsubscribe-auth/AHuJtwOirV-PgLcbbWynnLgAc-Xgmmfwks5sPmNsgaJpZM4OZfC4 .

-- PhD Candidate, Project Researcher Sustainable Fisheries Group University of California, Santa Barbara