KEMBAR78
Better REUC generation when merging by vmg · Pull Request #3489 · libgit2/libgit2 · GitHub
Skip to content

Conversation

@vmg
Copy link
Member

@vmg vmg commented Oct 27, 2015

First, we optimize the way REUC insertion works to make it hundreds of times faster (from 17s to 200ms when inserting 39k entries).

Second, we add a merge trees flag that allows us to skip the REUC generation altogether (for users that don't need to display merge results).

Lastly, we plug a small memory leak that we introduced with the FAIL_ON_CONFLICT flag.

cc @carlosmn @ethomson

vmg added 3 commits October 27, 2015 22:44
Inserting new REUC entries can quickly become pathological given that
each insert unsorts the REUC vector, and both subsequent lookups *and*
insertions will require sorting it again before being successful.

To avoid this, we're switching to `git_vector_insert_sorted`: this keeps
the REUC vector constantly sorted and lets us use the `on_dup` callback
to skip an extra binary search on each insertion.
@nkeck720
Copy link

Nice, clean code here.
On Oct 27, 2015 5:46 PM, "Vicent Marti" notifications@github.com wrote:

First, we optimize the way REUC insertion works to make it hundreds of
times faster (from 17s to 200ms when inserting 39k entries).

Second, we add a merge trees flag that allows us to skip the REUC
generation altogether (for users that don't need to display merge results).

Lastly, we plug a small memory leak that we introduce with the
FAIL_ON_CONFLICT flag.

cc @carlosmn https://github.com/carlosmn @ethomson

https://github.com/ethomson

You can view, comment on, or merge this pull request online at:

#3489
Commit Summary

  • reuc: Be smarter when inserting new REUC entries
  • merge: Implement GIT_MERGE_TREE_SKIP_REUC
  • merge: Plug memory leak

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#3489.

@carlosmn
Copy link
Member

👍 the new reuc insertion code is easier to read to boot.

vmg pushed a commit that referenced this pull request Oct 28, 2015
Better REUC generation when merging
@vmg vmg merged commit efc659b into master Oct 28, 2015
@ethomson
Copy link
Member

👍

@ethomson ethomson deleted the vmg/reuc-insert branch January 9, 2019 10:20
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.

4 participants