Skip to content

Conversation

arxanas
Copy link
Owner

@arxanas arxanas commented Sep 6, 2021

No description provided.

This function appears to have been incorrect when comparing tree and non-tree entries.
In order to compute the correct diff during a cherry-pick, we need to dehydrate the merge-base as well. Otherwise, the diff will logically delete a lot of files, which may not exist at the target commit.
The results on the gecko-dev repository (https://github.com/mozilla/gecko-dev) show around 500x speedup for in-memory cherry-picks:

```
$ PATH_TO_REPO="$HOME/workspace/gecko-dev" cargo bench cherrypick
Benchmarking Cherrypick/Repo::cherrypick_commit: Warming up for 3.0000 s
Warning: Unable to complete 10 samples in 5.0s. You may wish to increase target time to 19.0s.
Cherrypick/Repo::cherrypick_commit
                        time:   [1.8935 s 1.9011 s 1.9088 s]
                        change: [-1.7816% +2.5204% +7.0223%] (p = 0.29 > 0.05)
                        No change in performance detected.
Cherrypick/Repo::cherrypick_fast
                        time:   [2.7665 ms 2.8209 ms 2.9297 ms]
                        change: [-1.1128% +1.4992% +4.9619%] (p = 0.38 > 0.05)
                        No change in performance detected.
```
Git itself calls the command `git cherry-pick`, but `libgit2` exposes functions called `cherrypick`. This commit separates the term into two words.
@arxanas arxanas force-pushed the in-memory-fast-rebase branch from f13102b to 49b8d4e Compare September 6, 2021 05:44
@arxanas arxanas merged commit ec0d274 into master Sep 6, 2021
@arxanas arxanas deleted the in-memory-fast-rebase branch September 6, 2021 06:13
@arxanas arxanas mentioned this pull request Sep 6, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant