]> source.dussan.org Git - jgit.git/commit
Optimize RefAdvertiser for wire protocol 24/75524/1
authorShawn Pearce <spearce@spearce.org>
Sun, 19 Jun 2016 04:40:35 +0000 (21:40 -0700)
committerShawn Pearce <spearce@spearce.org>
Sun, 19 Jun 2016 04:41:07 +0000 (21:41 -0700)
commit2ec3accb3bcc0bd45dfb1333511c72489ab835cb
tree254acfa17ca33a0e3806ff7ddee9cbe1b25c32ad
parent48cb5ffba6d2b11aea407cdd93e5a8ffb7bfec17
Optimize RefAdvertiser for wire protocol

The native wire protocol sends ref advertisements in the pkt-line
format, which requires encoding the ObjectId and ref name onto a byte
sequence.  Busy servers show this is a very high source of garbage,
which pushes the garbage collector harder when there are many refs in
the repository (e.g.  70k, in a Gerrit managed repository).

Optimize the side band advertiser by retaining the CharsetEncoder,
minimizing the amount of temporary garbage built during encoding.

Change-Id: I406c654bf82c1eb94b38862da2425e98396134cb
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/RefAdvertiserTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineOut.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java