Mercurial > public > mercurial-scm > hg-stable
diff mercurial/sshserver.py @ 17563:46db0ec640f3
sshserver: avoid a multi-dot attribute lookup in a hot loop
This improves stream_out performance by about 3%.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 14 Sep 2012 12:09:44 -0700 |
parents | a348739da8f0 |
children | 8d477543882b |
line wrap: on
line diff
--- a/mercurial/sshserver.py Fri Sep 14 12:09:05 2012 -0700 +++ b/mercurial/sshserver.py Fri Sep 14 12:09:44 2012 -0700 @@ -71,8 +71,9 @@ self.fout.flush() def sendstream(self, source): + write = self.fout.write for chunk in source.gen: - self.fout.write(chunk) + write(chunk) self.fout.flush() def sendpushresponse(self, rsp):