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

Better REUC generation when merging #3489

Merged
merged 3 commits into from Oct 28, 2015

Conversation

Projects
None yet
4 participants
@vmg
Copy link
Member

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 some commits Oct 27, 2015

reuc: Be smarter when inserting new REUC entries
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

This comment has been minimized.

Copy link

nkeck720 commented Oct 27, 2015

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

This comment has been minimized.

Copy link
Member

carlosmn commented Oct 28, 2015

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

vmg added a commit that referenced this pull request Oct 28, 2015

Merge pull request #3489 from libgit2/vmg/reuc-insert
Better REUC generation when merging

@vmg vmg merged commit efc659b into master Oct 28, 2015

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ethomson

This comment has been minimized.

Copy link
Member

ethomson commented Oct 28, 2015

👍

@ethomson ethomson deleted the vmg/reuc-insert branch Jan 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment