Extend packfile in increments of page_size.#4053
Merged
ethomson merged 1 commit intolibgit2:masterfrom Jan 21, 2017
Merged
Conversation
This improves performance by reducing the number of I/O operations.
173f3cf to
c7a1535
Compare
Member
|
That's quite an improvement. Thanks, @chescock ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have an application that uses LibGit2Sharp, and it's been having performance issues doing fetches. Using the profiling technique of running it in the debugger and pausing it, I discovered it was spending a lot of time calling
p_writefromappend_to_packto write a single byte.I guessed that there was a cost for each call that actually extended the file, and that we could reduce the overall cost by rounding the size up so that we extend the file fewer times in larger chunks. I'm using
mmap_alignmentfor the rounding since that was used in the nearbywrite_atmethod, but I don't know whether or not that's an appropriate value.A local fetch of the libgit2 repository on my Windows 7 machine takes 307s without this change and 43s with it, for a 7x speedup, and the fetch goes from being I/O-bound to CPU-bound.