Mercurial > public > mercurial-scm > hg-stable
diff tests/test-wireproto.py @ 28438:48fd02dac1d4
wireproto: make iterbatcher behave streamily over http(s)
Unfortunately, the ssh and http implementations are slightly different
due to differences in their _callstream implementations, which
prevents ssh from behaving streamily. We should probably introduce a
new batch command that can stream results over ssh at some point in
the near future.
The streamy behavior of batch over http(s) is an enormous win for
remotefilelog over http: in my testing, it's saving about 40% on file
fetches with a cold cache against a server on localhost.
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 01 Mar 2016 18:41:43 -0500 |
parents | 5defcb7d6e5f |
children | fcafd84bc9c5 |
line wrap: on
line diff
--- a/tests/test-wireproto.py Tue Mar 01 17:44:41 2016 -0500 +++ b/tests/test-wireproto.py Tue Mar 01 18:41:43 2016 -0500 @@ -1,5 +1,7 @@ from __future__ import absolute_import +import StringIO + from mercurial import wireproto class proto(object): @@ -21,6 +23,9 @@ def _call(self, cmd, **args): return wireproto.dispatch(self.serverrepo, proto(args), cmd) + def _callstream(self, cmd, **args): + return StringIO.StringIO(self._call(cmd, **args)) + @wireproto.batchable def greet(self, name): f = wireproto.future()