Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Better REUC generation when merging #3489
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
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.
Nice, clean code here.