jgit/org.eclipse.jgit
Shawn O. Pearce 2156aa894c Reduce multi-level buffered streams in transport code
Some transports actually provide stream buffering on their own,
without needing to be wrapped up inside of a BufferedInputStream in
order to smooth out system calls to read or write.  A great example
of this is the JSch SSH client, or the Apache MINA SSHD server.
Both use custom buffering to packetize the streams into the encrypted
SSH channel, and wrapping them up inside of a BufferedInputStream
or BufferedOutputStream is relatively pointless.

Our SideBandOutputStream implementation also provides some fairly
large buffering, equal to one complete side-band packet on the main
data channel.  Wrapping that inside of a BufferedOutputStream just to
smooth out small writes from PackWriter causes extra data copies, and
provides no advantage.  We can save some memory and some CPU cycles
by letting PackWriter dump directly into the SideBandOutputStream's
internal buffer array.

Instead we push the buffering streams down to be as close to the
network socket (or operating system pipe) as possible.  This allows
us to smooth out the smaller reads/writes from pkt-line messages
during advertisement and negotation, but avoid copying altogether
when the stream switches to larger writes over a side band channel.

Change-Id: I2f6f16caee64783c77d3dd1b2a41b3cc0c64c159
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-03-12 16:08:14 -08:00
..
.settings Adding PDE API Tools nature to JGit 2010-01-16 10:00:30 -06:00
META-INF Cleanup OSGi Import-Package specifications to use versions 2010-02-02 20:03:03 -08:00
findBugs Initial JGit contribution to eclipse.org 2009-09-29 16:47:03 -07:00
src/org/eclipse/jgit Reduce multi-level buffered streams in transport code 2010-03-12 16:08:14 -08:00
.classpath Partial revert "Switch build to Apache Felix maven-bundle-plugin" 2010-01-10 15:59:03 +01:00
.fbprefs Initial JGit contribution to eclipse.org 2009-09-29 16:47:03 -07:00
.gitignore Finish removing Apache Felix maven-bundle-plugin 2010-01-12 11:46:55 -08:00
.project Adding PDE API Tools nature to JGit 2010-01-16 10:00:30 -06:00
about.html Adding some Eclipse-related legal files to JGit 2010-02-03 15:18:06 -06:00
build.properties Adding some Eclipse-related legal files to JGit 2010-02-03 15:18:06 -06:00
plugin.properties Correct bundle, provider names to be consistent 2010-01-23 11:42:15 -08:00
pom.xml Use build timestamp as OSGi version qualifier 2010-01-23 01:29:21 +01:00