Mercurial > public > mercurial-scm > hg-stable
diff mercurial/wireproto.py @ 17558:380a89413403
wireproto: don't format a debug string inside a hot loop
This improves stream_out performance by about 5%.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 14 Sep 2012 12:06:40 -0700 |
parents | 6d97dd630d79 |
children | 2ee7281e5aaa |
line wrap: on
line diff
--- a/mercurial/wireproto.py Fri Sep 14 12:05:37 2012 -0700 +++ b/mercurial/wireproto.py Fri Sep 14 12:06:40 2012 -0700 @@ -548,11 +548,13 @@ sopener = repo.sopener oldaudit = sopener.mustaudit + debugflag = repo.ui.debugflag sopener.mustaudit = False try: for name, size in entries: - repo.ui.debug('sending %s (%d bytes)\n' % (name, size)) + if debugflag: + repo.ui.debug('sending %s (%d bytes)\n' % (name, size)) # partially encode name over the wire for backwards compat yield '%s\0%d\n' % (store.encodedir(name), size) if size <= 65536: