isacikgoz / gitbatch

manage your git repositories in one place
MIT License
1.54k stars 53 forks source link

Slow startup / high CPU with lots of repos #50

Closed gavinws closed 5 years ago

gavinws commented 5 years ago

I have a directory containing about 160 git repos (most are very small, with 1 or 2 "big" repos) and it takes about 3 minutes for the app to load up on my Macbook Pro (2014 w/ SSD), pegging my CPU until it's done loading them all.

I tried with --recursive-depth=0 and it made no difference.

This happens every time I launch it as well. Should there be some caching mechanism to save time on subsequent starts?

isacikgoz commented 5 years ago

It depends on how big is the repositories. Since gitbatch loads every repository with all its belongings such as every commit etc. It may be slow on a laptop with that much repositories. It is an expected situation IMHO. Still, if you don't need the GUI, you can fetch pull without opening the app.

gitbatch -q -m fetch command will run without fully initializing repositories. but will not open a GUI. Anyways, it will do the job very fast (multi-threaded)

Caching is not easy thing since repositories are already complex structures. I can recommend you to split repositories if some are staled.

isacikgoz commented 5 years ago

hi @gavinws I implemented async loading with #54 you don’t have to wait large repos anymore

gavinws commented 5 years ago

Hey, sorry for the lack of response to your comments. Thank you for working on this issue! The experience is indeed much improved, and gitbatch -q -m fetch is probably what I should be using mostly anyway (it seems very fast!).

BTW my interest in this tool after seeing it on reddit (or was it HN) was to do what http://mixu.net/gr/ does, but faster (parallel tasks). For my main use case of git pull on all my active repos this is at least worth trying out for a while! 😄