git-cola takes long to start on very large repos #499

Closed
jlec opened this Issue Sep 17, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@jlec
Contributor

jlec commented Sep 17, 2015

Please checkout https://anongit.gentoo.org/git/repo/gentoo.git and start git-cola. it takes very long, where as a simple git status -v or similar is fast. Perhaps some optimizations can be done here.

@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Jan 24, 2017

Member

Taking a closer look, here's a guess. Do you have cola.browserdockable configured to true?

That option is opt-in because having the File Browser as a dockwidget makes it slow to startup since it'll spend a bunch of time looking up the last latest commit message and modfication time for every file in the repo. Startup time is decent when cola.browserdockable is turned off.

It's a nice feature, but when dealing with larger repos this stuff starts to become a drag. We don't have a fast way in Git to ask for the author, most recent commit message, and date for every file in the repo without querying each file individually, so the File Browser tool does just that.

The operation is O(N) for the number of files in the repo, so being able to shut off the message/author/date feature in exchange for performance seems like a good trade off. We can add a cola.fastmode config knob to enable this mode.

It may be possible to defer updating the browser details until after the widget is shown, which we'll do as well. Let me know if my hunch about the browser setting is on the right path.

Member

davvid commented Jan 24, 2017

Taking a closer look, here's a guess. Do you have cola.browserdockable configured to true?

That option is opt-in because having the File Browser as a dockwidget makes it slow to startup since it'll spend a bunch of time looking up the last latest commit message and modfication time for every file in the repo. Startup time is decent when cola.browserdockable is turned off.

It's a nice feature, but when dealing with larger repos this stuff starts to become a drag. We don't have a fast way in Git to ask for the author, most recent commit message, and date for every file in the repo without querying each file individually, so the File Browser tool does just that.

The operation is O(N) for the number of files in the repo, so being able to shut off the message/author/date feature in exchange for performance seems like a good trade off. We can add a cola.fastmode config knob to enable this mode.

It may be possible to defer updating the browser details until after the widget is shown, which we'll do as well. Let me know if my hunch about the browser setting is on the right path.

davvid added a commit that referenced this issue Jan 25, 2017

browse: optimize the Column info class
The helper methods are called very often so make them as fast as
possible.

Related-to: #499
Signed-off-by: David Aguilar <davvid@gmail.com>

davvid added a commit that referenced this issue Jan 25, 2017

gitcmds: add a fast Git-based listdir() implementation
Add a function that returns the tracked and untracked paths for a given
directory.  This function exists because it honors Git's .gitignore.

Related-to: #499
Signed-off-by: David Aguilar <davvid@gmail.com>

@davvid davvid closed this in 2e9037b Jan 25, 2017

davvid added a commit that referenced this issue Jan 25, 2017

Merge branch 'perf'
Speed up the File Browser when operating on large repositories.

* perf:
  browse: vastly speed up File Browser performance
  browse: combine factory functions
  gitcmds: add a fast Git-based listdir() implementation
  browse: optimize the Column info class

Closes #499
Signed-off-by: David Aguilar <davvid@gmail.com>

davvid added a commit to davvid/git-cola that referenced this issue Jan 26, 2017

browse: another micro-opt for performance
Avoid calling into the gitcfg interface from background threads, which
should further reduce stat() traffic.

Related-to: #499
Signed-off-by: David Aguilar <davvid@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment