comparison 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
comparison
equal deleted inserted replaced
17562:b42b0729744d 17563:46db0ec640f3
69 self.fout.write("%d\n" % len(v)) 69 self.fout.write("%d\n" % len(v))
70 self.fout.write(v) 70 self.fout.write(v)
71 self.fout.flush() 71 self.fout.flush()
72 72
73 def sendstream(self, source): 73 def sendstream(self, source):
74 write = self.fout.write
74 for chunk in source.gen: 75 for chunk in source.gen:
75 self.fout.write(chunk) 76 write(chunk)
76 self.fout.flush() 77 self.fout.flush()
77 78
78 def sendpushresponse(self, rsp): 79 def sendpushresponse(self, rsp):
79 self.sendresponse('') 80 self.sendresponse('')
80 self.sendresponse(str(rsp.res)) 81 self.sendresponse(str(rsp.res))