diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2011-06-24 12:55:19 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2011-06-24 12:55:19 -0700 |
commit | 1eecc82cec2409ed3b69cf96f3206a2fb6c7b9f1 (patch) | |
tree | df733b01405e138992f2347b617c0346e2df57c5 /tools | |
parent | 826fb260a3515c86eba9e65e54695c78a085425c (diff) | |
download | jgit-1eecc82cec2409ed3b69cf96f3206a2fb6c7b9f1.tar.gz jgit-1eecc82cec2409ed3b69cf96f3206a2fb6c7b9f1.zip |
Improve performance when writing trees and small blobs
ObjectDirectoryInserter was always creating a temporary file,
writing the complete compressed contents of a tree, fsync()'ing
that to stable storage, and only then checking to see if there
was already an object with the same SHA-1 in the repository.
For commits this strategy makes some sense, the commit is very
unlikely to exist in the repository, as there are embedded times
and these change with each commit.
However for trees coming out of DirCache, it is more common for the
tree to already exist in the repository. Most subdirectories are
not modified in any given commit. Doing all of this local file IO
for things that already exist is very slow.
Try to detect cases where the object is "small enough" that it can
be processed entirely in memory, and avoid doing disk IO entirely
if the object already exists.
Also increase the size of the output buffer for the deflation.
This should boost the average write(2) syscall size from 512 bytes
to 8192 bytes, making streaming of large compressed contents to
disk slightly more efficient.
Change-Id: I1d40364e8725468522435814631916d73174c92b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions