Speeding up "Fetching older commits"
Asked by Oz Solomon:

Although SourceTree 2.0 (Win) is supposed to be much faster than the 1.9 versions, I find it considerably slower. It's keeps saying "Fetching older commits" when I switch branches or otherwise try to browse commit history. This takes 5-10 seconds on my repository. To be clear, this time is on top of the time spent on the git operation.

Does anybody have any idea if there is any setting I can turn on to speed this up?


Answers:
author: Alexander Willemse
body: Hi, i like to jump into this one, i have the same problem, and most of the time it's not finishing even if you wait 10min, however... if you just restart the application it will load everything in 10sec with no problems, this works for me atm so i don't have to wait everytime.

<br />

i don't think it's the amount of reads what is taking the time, if you restart the app, its hardly taking any time to show whatever you need, most of the time this is happening when the app is open for a longer time.


author: minnsey
body: Hi,

We put a lot of work into speeding up SourceTree for the 80% of usecases, most of this has been around simplifying the UI and using libgit2 in place of git.exe for many local operations. See  
<https://blog.sourcetreeapp.com/2017/05/05/sourcetree-2-0-for-windows-3x-faster-than-sourcetree-1-9/>  
and <https://blog.sourcetreeapp.com/2017/04/27/sourcetree-for-windows-2-0-new-ui-faster-performance-and-microsoft-git-virtual-file-system-support/>  

However it is likely there are some usecases where we can do more, yours sound like one. The 'Fetching older commits' appears when SourceTree is scrolling back through the history, since libgit2 is in process it can consume excessive memory unless it is batched.  

There is a setting in the Tools/Options/General tab where you can adjust the batch size. See the attached image.  

Can I also ask do you have large numbers of commits between branches? What might be a typical number?

<br />

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/1276i57FD185261435A2F/image-size/large?v=v2&px=999 "Capture.PNG")


author: ric
body: It is now March 2018, Sourcetree v2.4.8, and this is still an issue.

The Sourcetree experience since v1.6 has been very disappointing.

comments: author: tuliomir
body: I agree that the sourcetree experience has been degrading to a point of being unusable on common computers, even with a project with moderately low amount of commits and branches.  
I'm only able to use it (current version: 2.7.6) with reasonable performance and response times when running on a latest generation macbook pro, with a SSD disk.


author: Oz Solomon
body: I'll add that upgrading to 2.1 didn't help much.

A related issue that is slowing down SourceTree (which may appear under the banner of Fetching Old Commits) is the slowness of submodule handling: <https://community.atlassian.com/t5/SourceTree-questions/How-to-disable-the-slow-git-submodule-status-calls-in-SourceTree/qaq-p/586884>

If you are using submodules, please vote the bug linked from the above mentioned discussion. I personally have had to switch away from SourceTree since it's become so unusably slow. I'm monitoring releases with the hopes that the performance is fixed so I can come back.


author: Oz Solomon
body: Both cases exist (minimal and many differences). Looks like SourceTree is stuggling when there are more than a handful of differences.


author: Oz Solomon
body: Hi Michael,

Thank you for your answer. I'm running ST 2.0.20.1 and my Options-\>General doesn't look like yours. The "Log rows to fetch per load" is not listed as an option (see image).

![2017-05-16_8-24-25.png](https://community.atlassian.com/t5/image/serverpage/image-id/1282i9C8E4E5876C59CEA/image-size/large?v=v2&px=999 "2017-05-16_8-24-25.png")

I'm not sure what you mean by "commits between branches". I'm including two representative graph images of the repo. It is common to see many PR merges throughout. There a \*many\* branches all over the place, many of them live, and many of them old. If you need more information please contact me directly.

![2017-05-16_8-26-05.png](https://community.atlassian.com/t5/image/serverpage/image-id/1279iEFA1366E14E29068/image-size/large?v=v2&px=999 "2017-05-16_8-26-05.png")

![2017-05-16_8-27-45.png](https://community.atlassian.com/t5/image/serverpage/image-id/1281i92F4F06AB3E9B8C4/image-size/large?v=v2&px=999 "2017-05-16_8-27-45.png")

comments: author: minnsey
body: Ah apologies, that was a screen shot from the latest beta for 2.1, I forgot it wasn't in 2.0.... but it is coming.  

I was just wondering if there are a lot of changes/differences between branches, hence SourceTree needs to read a lot of history when moving between branches and reseting the UI to show the new branch/commit.  

The reverse would be two branches with minimal differences, e.g. just 1 commit different where SourceTree does not need to read much history to refresh the UI.