diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-02-12 07:00:32 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-03-12 16:10:30 -0800 |
commit | 89cdc3b713c214a8f7142ef0d0df714027ad9876 (patch) | |
tree | 9bd13941aef7dc6266463452f55e87200d942ec7 /org.eclipse.jgit.pgm | |
parent | c0f093899f8c027fb4e0f4418ac19b0f8ad6be16 (diff) | |
download | jgit-89cdc3b713c214a8f7142ef0d0df714027ad9876.tar.gz jgit-89cdc3b713c214a8f7142ef0d0df714027ad9876.zip |
Reuse the line buffer between strings in PacketLineIn
When reading pkt-lines off an InputStream we are quite likely to
consume a whole group of fairly short lines in rapid succession, such
as in the have exchange that occurs in the fetch-pack/upload-pack
protocol. Rather than allocating a throwaway buffer for each
line's raw byte sequence, reuse a buffer that is equal to the small
side-band packet size, which is 1000 bytes. Text based pkt-lines
are required to be less than this size because many widely deployed
versions of C Git use a statically allocated array of this length.
Change-Id: Ia5c8e95b85020f7f80b6d269dda5059b092d274d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.pgm')
0 files changed, 0 insertions, 0 deletions