# HG changeset patch # User Mads Kiilerich # Date 2013-04-15 22:40:21 # Node ID 07e40d589b6478934bd819e5aca95ba589b1db6a # Parent 9d33d6e0d442df89d514859306dda3a1a0bd2749 largefiles: use filechunkiter for iterating largefile when serving getlfile The default file iterator is line based and will give odd chunk sizes - often very short and relatively expensive. diff --git a/hgext/largefiles/proto.py b/hgext/largefiles/proto.py --- a/hgext/largefiles/proto.py +++ b/hgext/largefiles/proto.py @@ -63,7 +63,7 @@ def getlfile(repo, proto, sha): # ssh proto does for string responses. def generator(): yield '%d\n' % length - for chunk in f: + for chunk in util.filechunkiter(f): yield chunk return wireproto.streamres(generator())