SourceTree painfully slow

SourceTree is running very, very, slow at times. Restarting it seems to work temporarily, but it's still quite a nuisance, specially when I have to do it every couple of ours. When ST starts slowing down, I also see the CPU usage rising to 80%-300%.

I'm using SourceTree 1.5.7.1 now, but it was also happening with 1.5.7.

This might be the same issue. See my process sample taken with Activity Monitor here.

31 answers

1 accepted

Your clue was in your second-to-last sentence (around 13,000 untracked files). This is a Git problem rather than a SourceTree one. There are two solutions to this problem

  1. Ignore the files you don't want (perhaps all 13,000 of them)
  2. Use the 'Show Modified' filter - this is the same as 'Show Pending' except it omits untracked files.

It's a Git performance problem from the looks of it.

Have a try and let us know how you get on. Cheers!

Thanks, that is it! It's still annoying keep changing the filter... but it's a workaround that works. I guess the solution will ultimately be to change my directory tree, and move all those unversioned files to somewhere else.

Or more simply, just right-click > Ignore...

Showing modified files doesn't allow deleting rejected files.

Simple solution for me (Win7 x64): Run it as administrator!

+1 here. Oddly enough, this works for me (was an easy fix). I've been having this issue for quite some time for thanks for the comment!

This did the trick for me as well, wtf ? Anyway, thanks Oliver.

Wow! Makes a BIG difference!

how do i do what you recommend? "Use the 'Show Modified' filter - this is the same as 'Show Pending' except it omits untracked files." mine is so slow i cannot even get to options and file menu items without it taking an hour. when you explain something, can you take a second to state the click path?

Ok sorry. Is it OK that we continue this thread even if I'm talking about the Windows version?

I've created a reproducable (at least on my computer) recipe. Please enter these commands from a windows command linewith git support:

git clone https://android.googlesource.com/platform/frameworks/volley
cd volley
echo Hi > src\com\android\volley\Request.java
echo Hi > build.xml

Then start sourcetree, goto master branch and the "uncommited changes" point. The two files build.xml and Request.java should be listed under "Working copy changes". Select build.xml. Press the up-arrow.

At this point my computer uses from ~500 to 1000ms to process the diff. In this timespan, pressing the down-arrow will not trigger any reaction from sourcetree, but will trigger after the diff is presented. If I repeat the process by alternating between up-and down-arrow int he window, the delay is even more obvious.

I have noticed a correlation between the size of the source file and the length of processing (Request.java is some ~18kb). Yet there are two things make me say that this shouldn't take that long:

  1. "git diff Request.java" on the command line peforms way better than Sourcetree
  2. My change is trivial (basically truncated the file)

My computer specs are:

Intel Core i5-2467M @ 1.60 GHz . 6GB RAM. Windows 8. (Toshiba laptop Z830).

How do I disable preview pane completely !?!?

This is ridicilous, my whole PC stuck because of this.

Have tried version 1.0.6. for windows

It's much faster then previous versions!

Thx guys.

I'm beginning to think that Source Tree is just very slow full stop, I have one repository maybe a couple of thousand files yet source tree just goes awol every time I do anything.

Git works like a dream on the same repository under Linux

Maybe its just me but the same things which take 10 seconds on Linux (command line) seem to take about 1-2 minutes on Windows with Source Tree

For whatever its worth, when connected to BitBucket, switching to an ssh connection instead of an http connection really sped up all git operations for me both in SourceTree and the CLI.

Hi Filipe,

Have you got any further details about your system? For example, CPU/memory/free hard disk space etc. Sometimes this is a clue for us to figure out what's going on. Also, do you have a lot of repositories in your bookmarks?

Hi.

It's a 2.3GHz Core i5 Macbook Pro. 8GB of RAM. And I currently have around 95GB free disk space.

I do have a few repositories. 17, to be more specific. 16 git and 1 mercurial.

This might have started with a ST update, but I can't say for sure. I can try using a version older than 1.5.7 if you still have them for download.

It's worth a shot if you can reproduce it, that'll really help us narrow it down if that's the case. Here's the link: http://downloads.atlassian.com/software/sourcetree/SourceTree_1.5.7.dmg

Thanks very much

Thanks. Do you think I will have any trouble installing this version after having used a 1.5.7.1? E.g., will it keep my repository bookmarks?

Hi. Like I said, I was also seeing this with 1.5.7 (I remember upgrading to 1.5.7.1 hoping that it would solve the issue). Do you know what is the version number before that?

Yup, your settings are stored elsewhere so it won't be a problem.

Ok, great. I'll use it for a while and report back the results.

Version 1.5.6 is showing the same symptoms :(

Even when ST's windows is in the background, I frequently see it taking up 100% of the CPU.

I've also tried checking if there's a relation between the slowness, and disk activity (as reported by Activity Monitor), but I could establish none.

Also, ST is currently taking 1.13GB of memory (which is more than my IDE). Is this to be expected?

Anything else I can do to sort this out?

Just to try and narrow this down further before we do more thorough investigating, are you using system git/hg or embedded?

Embedded.

And both ST 1.5.6 and 1.5.7.1 report version 1.1.7.11.1 of Git.

OK, 17 repositories should be fine, it may be to do with what you're doing with those repo's. Sorry for all the questions, it helps us narrow it down. Some more: are you using any particular views when this is happening, if so, which ones? Do you have 'All Files' selected? Are you using large selections with lots of large diffs or selecting ignored/clean/untracked files?

I usually have only two windows open. The bookmarks window and the window for the project that I'm working on. I can't establish a clear relation between the view I'm at and the slowness. But there are two situations in which I see this issue happening more often: a) when I have the "Uncommited changes" selected in the top panel, and start selecting some modified files (one at a time) to see what my latest changes were, and b) when I open up the commit dialog.

Then again, these are the features that I use more often, so not having felt all the slowness when working with other features of ST may not really mean anything. I spend ~80% of the time is the log view.

Do you have 'All Files' selected?

You mean, if I select all the files in the "Files in the working tree" pane? If so, no.

Are you using large selections with lots of large diffs

No, not really

or selecting ignored/clean/untracked files?

Not really either. But I do have a lot of untracked files in the project that I have been working on recently (around 13000).

PS: Sorry for the delay in answering back, I had to focus my attention on something else in the last 2 days, but I appreciate your help in trying to sort this out.

I would also jump into this and say that I don't have lots of untracked files. In fact my sisytem is pretty basic and it's slow. It will litterally cause my mustic to pause while it's figuring itself out..

By default SourceTree displays files with a filter it calls 'Show Pending', which includes both modified files and untracked files. Unfortunately git itself really starts to slow down when you have a lot of untracked files - usually you don't want to keep lots of untracked files around and you want to ignore them or add them (otherwise it gets hard to see the wood for the trees). However, if for some reason you want to keep all these untracked files sitting in your repo, you can speed up SourceTree by selecting the 'Show Modified' filter instead for the majority of the time. This is a lot faster because it avoids the slow call to list untracked files.

I am using 1.7.3 on MacOS and I have the same issue. When returning to SourceTree from another program I will often have to wait a minute or more while SourceTree grinds away at something. It uses all available CPU and basically makes my whole machine unusable while this is happening. I do not have lots of untracked/unignored files. I have 20 or so git repos, but only one or two windows open at any given time. I can fix this temporarily by restarting, but even getting SourceTree to quit in those times is a painfully slow process.

I use SourceTree and have the same problem. After launch it seems good, but after 3-4 hours SourceTree freezes everywhere even between switching tabs.

I will try to record a video which will demonstrate the issue.

I use windows version 1.0.4.0 and my filter was setted up to 'Show pending'. I don't have many untracked files and have only 7 reps.

This is actually a different issue (Windows specific) - with all the features that have been added to get us to 1.0 on Windows we haven't had chance to spend time simply profiling to catch things like this - we're addressing that now. I've already managed to speed a great number of things up for the next Windows update (1.0.5), and I intend to try to find some more before that release next week. We'll be improving things all the time; it's still fairly early days for the Windows release.

Ok, thx Steve.

Will wait the new release.

SourceTree 1.5.6 was slow for me too on a but I managed to get SourceTree to perform a lot faster by doing the following:

  • Set language in Preferences
  • Disable automatic refresh
  • Use fixed-width font for commit messages
  • Set diff context to 1 line

I'm too lazy to figure out which specific one made it faster or whether it was a combination of these settings, but perhaps Atlassian could look into this. Hope it helps. SourceTree was much slower than the latest version of GitX (rowanj's fork) until I made these changes. I also disabled backups on destructive operations but noticed it made no difference when I re-enabled it.

My specs: MacBook Pro 15" late-2011 2.2GHz i7 with 8GB RAM.

p.s. the moderators might want to merge this thread with this other one.

Hey Kris,

1.5.6 is the MAS version. We're no longer allowed to publish to the MAS anymore, the latest version is 1.6.2.2 available on our website.

Regardless of that, your input is very useful, thanks for the insights. I am planning on performance maintenance in the near future. Our Windows client recently got a major speed boost due to investing in performance maintenance a bit more.

Most of the background checking / threading tasks took months to get right. Some people have very large repositories or very slow remotes. One major factor contributing to poor performance are repositories with lots of untracked files in them which aren't added to an ignore list, or where SourceTree's log preferences aren't set to view only tracked files. SourceTree has to call Git, and Git has to do a load of checks on the untracked files causing response to be very poor (because we're asking Git for the information).

I've created an issue here outlining what steps we should take. The first two would make more sense, and the last is imperative also. https://jira.atlassian.com/browse/SRCTREE-1706

Cheers

Hi Kieran

Thanks for your reply. I had no idea you were not publishing to the MAS anymore. Looks like I missed the recent blog articles about the sandbox issues.

I'm now trying out version 1.6.2.2 and have also reverted the preferences changes I did to know if it makes a difference (still using a fixed-width font for commit messages though).

You might be right about SourceTree being slow when there are a lot of untracked files that are not ignored. However I face this issue regularly not because I'm not ignoring files which should be ignored (in fact I'm quite zealous of keeping my working files list clean), but because I sometimes add folders containing many files which I need to commit later - for example vendor JS libraries. Renaming a folder that contains a lot of files that's already committed will also create a long list of working files. So this might actually be a regular use case that isn't actually due to a neglected gitignore file.

That said, I'll keep using the latest version and report back if there's anything noteworthy. Thanks for making such a great Git client and on top of that, releasing it for free.

Hi guys, came here from googling "Sourcetree cpu usage". Mine is very slow now when switching between uncommited & unstaged files. Suggestion: Dont do the file-compare on the UI thread. It seems as if it is happening now (haven't looked at the code). One should be able to quickly select mulitple files in the "Working Copy changes" pane without having to wait for the result of the Diff-view..

That said... Why are you guys talking about v1.5+? Isn't the latest verson as of Jan 23 2014 v1.3.3?

Hey Frode,

This thread is about the Mac version, hence the version numbers.

We definitely don't do the file compare on the UI thread, we're very careful when it comes to this and lots of testing is involved. It's a relatively obvious thing to perform actions like this on background threads.

We'd need more details to diagnose your issue. If the diff's are big, or lots of files are selected this is usually a result of Git taking a long time to respond.

Cheers

Hi, I am Takeshi.

This is my first post here. I want to introduce my case.

My colleagues use sourcetree on win 7 and win 8 and these are too slow.

I tried to solve it with information you provided here.

But I found another aspect ot this problem.

My colleagues are using trendmicro's "buisiness security" which is japanese trendmicro's solution and I don't know the name in another country.

When I stop the trendmicro's process from task manager, sourcetree become much faster.CPU utlization got small too.

And then I change the configuration of trendmicro's unti-virus software to exclude the working tree from monitoring, the result is same as stopping process.

Ofcource, here is risk that we cannot find virus from files while git pull from other remote repository, take care.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

241 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot