Rebase is getting fast! #49
Replies: 2 comments 3 replies
-
@Alphare: I know you told me to remember that speed is a feature when I presented this project to you a long time ago :) |
Beta Was this translation helpful? Give feedback.
-
@newren: I know you've spent a lot of time on Git's "ort" strategy. Some replies to your merge-tree patches today made me think that you might be interested in the above. I assume Git can eventually get equally fast. I actually thought To be clear, I don't have support for rename detection, so I won't pretend that |
Beta Was this translation helpful? Give feedback.
-
I made some performance improvements recently (particularly 94e03f5, f084a05, c058ffe), which made rebasing reasonably fast in most cases.
For example, rebasing 1272 commits in the git.git repo now takes 885 ms. That was a rebase that didn't rewrite any trees (I ran
jj describe v2.33.0 -m modified
to set the description of that commit). I can't directly compare that togit
's performance since it doesn't rebase merge commits correctly and would surely run into lots of conflicts (though I didn't even try).Changing the description of v1.8.5 in the git.git repo results in >30k commits getting rebased. That takes ~16 seconds.
For a more direct comparison, I tried rewriting git.git's "todo" branch. Rebasing the 1351 linear commits in ee2122992937..todo there took 644 ms with
jj
and 75.9 s withgit
(99.7 s with-s ort
). If I add a file in that branch so the trees need to be rewritten (jj co ee2122992937; echo a > new-file; time jj squash
), the rebase slows down to 1.39 s, which is still pretty reasonable.Rebasing is still somewhat slow on merge commits when trees need to be merged. For example, rebasing the 505 descendants of v2.34.0 in the git.git repo takes almost 13 seconds. The vast majority of that time is spent on merge commits. The problem is that merge commits are rebased by first re-merging their parents and then calculating the difference compared to that. I plan to fix that by keeping the re-merged parent tree in some persistent cache. That cache will also be used for e.g.
jj diff -r <merge commit>
so the parents don't need to be re-merged.Beta Was this translation helpful? Give feedback.
All reactions