# HG changeset patch # User Bryan O'Sullivan # Date 1347649784 25200 # Node ID 46db0ec640f339895e81a1be617f236b687f3b73 # Parent b42b0729744da3f119b24fd28088472599300d9c sshserver: avoid a multi-dot attribute lookup in a hot loop This improves stream_out performance by about 3%. diff -r b42b0729744d -r 46db0ec640f3 mercurial/sshserver.py --- 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):