-
Notifications
You must be signed in to change notification settings - Fork 14
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
Make performance counter #20
Comments
Yet one more ticket that I wanted to comment on. ;) From the description, it is not clear to me, what you want to accomplish with these metrics. I.e. repo size, number of branches are in and of themselves not performance counters. However, I am using this on a repo and it basically does not work because of performance reasons. I have ~3500 branches (
I was trying this earlier on this particular repo and I was running it env_logger set to "debug" level. That will provide some timings. As I said, it took to long and so I aborted it. |
Thank you for pointing it out. I've made this issue to leave some notes while closing this issue. Current log is quiet tedious to inspect. I might be able to find the slow spot with timgings in the log, but it doesn't tell me why it is slow. I wanted to make it easier to analyze. But was a vague idea and lost motivation since there hasn't been a performance issue after closing it. By the way, can you tell me how many local branches do you have? IIRC, total time should be proportional to the number of local branches by default, not total branches, except |
Here's the data you requested in the linked ticket.
Feature Request: Provide output during the run at which stage it is (out of how many total stages.) Ideally in the form of a status-bar. I am going to do two things next: (1) Run cargo-flamegraph (I tried but couldn't get it to work in a different directory.) . (2) Run it overnight. |
Thanks! However, requested features might take some time. I'm busy at work for months. Also I might be able to try to trim some branches even if it is aborted. |
Results from running the command over night: The logs look like it took 2:45h to run. (I.e. last log message timestamp minus first timestamp).
I have a feeling that this the complexity is non-linear? Then trimming only the first N branches would be beneficial. That would also be beneficial from the perspective of reviewing the proposed changes. |
git2::Repository::remotes() and find_remote(..) are incredibly slow. Calling them every time for each branch is unnecessarily slow. Please note that this is not yet the best way to implement this. We are still iterating through all remote.refspecs() for each branch. Just that all Remote structs are cached. An alternative would be to work on `expand_refspec()` and create a map/index of (branch name, remote branches) once. \foriequal0#20
git2::Repository::remotes() and find_remote(..) are incredibly slow. Calling them every time for each branch is unnecessarily slow. Please note that this is not yet the best way to implement this. We are still iterating through all remote.refspecs() for each branch. Just that all Remote structs are cached. An alternative would be to work on `expand_refspec()` and create a map/index of (branch name, remote branches) once. \foriequal0#20
@foriequal0 sorry to take your time again. I realize that you might be busy. If so, no need to respond. I identified Here's a list of things that I don't understand:
Many thanks and also totally fine if you don't have time to answer this. |
The basic isn't changed from this merge testing script: MERGE_BASE=$(git merge-base $BASE $BRANCH)
# Is branch merged by cherry-pick or rebase?
git rev-list --cherry-pick --right-only --no-merges -n1 $MERGE_BASE...$BRANCH # empty if merged
// Is branch merged by squash? https://stackoverflow.com/questions/43489303/how-can-i-delete-all-git-branches-which-have-been-squash-and-merge-via-github/56026209#56026209
TREE=$(git rev-parse $BRANCH^{tree})
SQUASH=git commit-tree $TREE -p $MERGE_BASE -m _)
git rev-list --cherry-pick --right-only --no-merges -n1 $MERGE_BASE...$SQUASH # empty if merged Also This is the core idea of
Also, I thought that calling |
FWIW, |
As far as I know, |
To diagnosis operations, I need a performance counter.
How many branches are there? How big is a repository? How long it takes for each operation?
The text was updated successfully, but these errors were encountered: