3r1co / hg4j

Automatically exported from code.google.com/p/hg4j
GNU General Public License v2.0
0 stars 1 forks source link

InflaterDataAccess performance degradation on sparse reads #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sequences of readByte() and skip() lead to a lot of Inflater.inflate() single 
byte calls that are quite ineffective.

Noticed when comparing HgChangesetFileSneaker performance against 
HgManifest.getFileRevision():

ManifestRevision mr = new ManifestRevision(null, null);
hgRepo.getManifest().walk(2, 2, mr);
mr.nodeid(fname);

vs.

hgRepo.getManifest().getFileRevision(2, fname);

Latter works faster when manifest revision is a patched baseRevision, however, 
if complete revision is hit, FileLookupInspector (from getFileRevision) get 
direct InflaterDataAccess over this complete revision, and a lot of 
readByte/skip slow it down few times more than ManifestRevision which inflates 
whole revision at once.

Original issue reported on code.google.com by tikhomir...@gmail.com on 16 Apr 2013 at 2:58

GoogleCodeExporter commented 8 years ago
InflaterDataAccess now buffers inflate operations, and getFileRevision is 
faster than complete manifest revision parse (tested with 
Main#checkFileSneakerPerformance()), revision 3c4db86e8c1f.

Original comment by tikhomir...@gmail.com on 16 Apr 2013 at 6:20