Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ijoseph opened this issue Nov 28, 2022 · 2 comments
Labels
question Further information is requested

Comments

@ijoseph
Copy link

ijoseph commented Nov 28, 2022

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 ijoseph changed the title Sluggish performance to choose branches to keep around on large (4.5k local branches) repo Sluggish performance to choose branches to keep around on large (4.5k local (including remote-tracking branches) repo Nov 28, 2022
@hartwork
Copy link
Owner

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 hartwork added the question Further information is requested label Nov 28, 2022
@ijoseph
Copy link
Author

ijoseph commented Nov 28, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants