Skip to content

Conversation

@Byron
Copy link
Collaborator

@Byron Byron commented Aug 27, 2024

Follow-up to #4757.

Get merge-base computation performance to be en-par with the cache-less variant in git2.
Prevously when there is no commit-graph cache, it was 7% slower than git2 (which is just as fast as Git itself),
which is likely due to Git2 leveraging already parsed objects between multiple merge-base queries.

gix has to learn that to be en-par or faster, and I think it's not going to take long.

Tasks

  • move rev-walking to the thread that deals with commits walks to leverage caches (from 6% slower to 4% slower)
  • performance comparison compared to the previous version that used git2 for merge-bases. (from 6% slower to 8% faster)
  • use latest version of gix (that can re-use the existing commit-graph cache (with parsed objects)

Performance

This was a win, as gix is now about 4% faster than Git (in one particular workload without commit-graph), and 8% faster than git2 thanks to greatly improved caching.
Memory consumption is still lower at 575MB compared to 617MB.

When a commit-graph is present (via git commit-graph write --reachable), then gix is 26% faster. Now it probably hits the boundary where diffing trees is the slowest operation, whereas merge-base computation is very quickly done (it's at least 10x faster then). Those who have repos big enough to use commit-graphs will certainly appreciate it.

That way, it can leverage already held commit-objects, and be faster
in the absence of a commitgraph.
@vercel
Copy link

vercel bot commented Aug 27, 2024

@Byron is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the rust Pull requests that update Rust code label Aug 27, 2024
Byron added 2 commits August 27, 2024 12:17
This time, it contains whole commits and only flags are reset
between runs. With this amount of re-use, it will manage
to rival `git2`.
@Byron Byron marked this pull request as ready for review August 27, 2024 10:22
@Byron Byron requested a review from krlvi August 27, 2024 10:22
Copy link
Member

@krlvi krlvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice improvements indeed :)

@Byron Byron enabled auto-merge August 27, 2024 10:28
@Byron Byron merged commit 7199105 into gitbutlerapp:master Aug 27, 2024
@Byron Byron deleted the git2-to-gix branch August 27, 2024 12:16
@Byron Byron mentioned this pull request Aug 27, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants