Mercurial > public > mercurial-scm > hg
comparison mercurial/wireproto.py @ 17556:39c6e349dfff
wireproto: don't audit local paths during stream_out
Auditing at this stage is both pointless (paths are already trusted by
the local repo) and expensive. Skipping the audits improves stream_out
performance by about 15%.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 14 Sep 2012 12:05:12 -0700 |
parents | e7cfe3587ea4 |
children | 6d97dd630d79 |
comparison
equal
deleted
inserted
replaced
17555:57eba8158736 | 17556:39c6e349dfff |
---|---|
543 '''stream out all metadata files in repository.''' | 543 '''stream out all metadata files in repository.''' |
544 yield '0\n' # success | 544 yield '0\n' # success |
545 repo.ui.debug('%d files, %d bytes to transfer\n' % | 545 repo.ui.debug('%d files, %d bytes to transfer\n' % |
546 (len(entries), total_bytes)) | 546 (len(entries), total_bytes)) |
547 yield '%d %d\n' % (len(entries), total_bytes) | 547 yield '%d %d\n' % (len(entries), total_bytes) |
548 for name, size in entries: | 548 |
549 repo.ui.debug('sending %s (%d bytes)\n' % (name, size)) | 549 sopener = repo.sopener |
550 # partially encode name over the wire for backwards compat | 550 oldaudit = sopener.mustaudit |
551 yield '%s\0%d\n' % (store.encodedir(name), size) | 551 sopener.mustaudit = False |
552 for chunk in util.filechunkiter(repo.sopener(name), limit=size): | 552 |
553 yield chunk | 553 try: |
554 for name, size in entries: | |
555 repo.ui.debug('sending %s (%d bytes)\n' % (name, size)) | |
556 # partially encode name over the wire for backwards compat | |
557 yield '%s\0%d\n' % (store.encodedir(name), size) | |
558 for chunk in util.filechunkiter(sopener(name), limit=size): | |
559 yield chunk | |
560 finally: | |
561 sopener.mustaudit = oldaudit | |
554 | 562 |
555 return streamres(streamer(repo, entries, total_bytes)) | 563 return streamres(streamer(repo, entries, total_bytes)) |
556 | 564 |
557 def unbundle(repo, proto, heads): | 565 def unbundle(repo, proto, heads): |
558 their_heads = decodelist(heads) | 566 their_heads = decodelist(heads) |