git-delete-merged-branches icon indicating copy to clipboard operation
git-delete-merged-branches copied to clipboard

Sluggish performance to choose branches to keep around on large (4.5k local (including `remote-tracking` branches) repo

Open ijoseph opened this issue 3 years ago • 2 comments

On the step [2/3] Which of these branches (if any) should be kept around at all times?

hitting the up and down arrow is very slow, giving a good 1s or more lag between hitting an arrow key and seeing response on the screen: out2

╰─ git branch --all | wc -l
    4889 

to be fair, this UI probably isn't practical with that many branches, anyway.

ijoseph avatar Nov 28 '22 19:11 ijoseph

Hi @ijoseph,

I think for me it's closer to 3 seconds even.

For anyone interested in an easy reproducer:

cd "$(mktemp -d)"
git clone --depth 1 https://github.com/hartwork/git-delete-merged-branches
cd git-delete-merged-branches/
python3 -m venv venv/
source venv/bin/activate
pip install -e .
for i in {0001..4500}; do echo -n . ; git branch "${i}"; done ; echo
git-delete-merged-branches --configure

I'd agree that the UI performance is not ideal with that many branches around. Without a closer look, I'm not sure if git-delete-merged-branches code or prompt-toolkit's is the problem here, maybe it's not prompt-toolkit.

Realistically, fixing this issue will not be one of my near future top priorities (..). If you can find time profiling and debugging the issue, I'd be curious what you find. What do you think?

hartwork avatar Nov 28 '22 19:11 hartwork

Sounds good! Yeah it’s not critical for me personally at least, because in practice I don’t want it keep around any of those branches, anyway, so I just hit enter. I’ll let you know if I get a chance to profile and look more into it!

ijoseph avatar Nov 28 '22 20:11 ijoseph