FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Extend packfile in increments of page_size. by chescock · Pull Request #4053 · libgit2/libgit2 · GitHub

Repository navigation

Extend packfile in increments of page_size. - #4053

Merged
ethomson merged 1 commit into
libgit2:masterfrom
chescock:extend-packfile-by-pages
Jan 21, 2017
Merged

ethomson merged 1 commit into
libgit2:masterfrom
chescock:extend-packfile-by-pages

Conversation

Copy link
Copy Markdown
Contributor

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_write from append_to_pack to 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_alignment for the rounding since that was used in the nearby write_at method, 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.

This improves performance by reducing the number of I/O operations.
chescock force-pushed the extend-packfile-by-pages branch from 173f3cf to c7a1535 Compare December 29, 2016 21:00

Copy link
Copy Markdown
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL