Submitter | phabricator |
---|---|
Date | Nov. 14, 2017, 6:26 a.m. |
Message ID | <differential-rev-PHID-DREV-rhqkxgqxj7opsrmzrtxj-req@phab.mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/25552/ |
State | Superseded |
Headers | show |
Comments
indygreg added a comment. FWIW, when I last looked at adding stream clones to bundle2, I held off because of the performance overhead. With the performance work in this series, I suspect bundle2's I/O is fast enough to support stream clones with minimal performance degradation. I may have a go at that once this series is queued because it is always something I've wanted to do. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1393 To: indygreg, #hg-reviewers Cc: mercurial-devel
durin42 added a comment. This series is great stuff. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1393 To: indygreg, #hg-reviewers, durin42 Cc: mercurial-devel
Patch
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1196,11 +1196,14 @@ dolog = ui.configbool('devel', 'bundle2.debug') debug = ui.debug - headersize = struct.calcsize(_fpayloadsize) + headerstruct = struct.Struct(_fpayloadsize) + headersize = headerstruct.size + unpack = headerstruct.unpack + readexactly = changegroup.readexactly read = fh.read - chunksize = _unpack(_fpayloadsize, readexactly(fh, headersize))[0] + chunksize = unpack(readexactly(fh, headersize))[0] indebug(ui, 'payload chunk size: %i' % chunksize) # changegroup.readexactly() is inlined below for performance. @@ -1227,7 +1230,7 @@ ' (got %d bytes, expected %d)') % (len(s), chunksize)) - chunksize = _unpack(_fpayloadsize, s)[0] + chunksize = unpack(s)[0] # indebug() inlined for performance. if dolog: