Mercurial > hg
comparison mercurial/exchangev2.py @ 40173:b797150a1ab9
exchangev2: honor server advertised manifestdata recommended batch size
Let's plug the client up to the server-advertised recommended batch size
for manifestdata requests.
Differential Revision: https://phab.mercurial-scm.org/D4976
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 03 Oct 2018 13:17:00 -0700 |
parents | 7a347d362a45 |
children | 41263df08109 |
comparison
equal
deleted
inserted
replaced
40172:30f70d11c224 | 40173:b797150a1ab9 |
---|---|
266 progress.increment() | 266 progress.increment() |
267 | 267 |
268 progress = repo.ui.makeprogress(_('manifests'), unit=_('chunks'), | 268 progress = repo.ui.makeprogress(_('manifests'), unit=_('chunks'), |
269 total=len(fetchnodes)) | 269 total=len(fetchnodes)) |
270 | 270 |
271 # Fetch manifests 10,000 per command. | 271 commandmeta = remote.apidescriptor[b'commands'][b'manifestdata'] |
272 # TODO have server advertise preferences? | 272 batchsize = commandmeta.get(b'recommendedbatchsize', 10000) |
273 # TODO make size configurable on client? | 273 # TODO make size configurable on client? |
274 batchsize = 10000 | |
275 | 274 |
276 # We send commands 1 at a time to the remote. This is not the most | 275 # We send commands 1 at a time to the remote. This is not the most |
277 # efficient because we incur a round trip at the end of each batch. | 276 # efficient because we incur a round trip at the end of each batch. |
278 # However, the existing frame-based reactor keeps consuming server | 277 # However, the existing frame-based reactor keeps consuming server |
279 # data in the background. And this results in response data buffering | 278 # data in the background. And this results in response data buffering |