Andrew, I believe you are correct about who is calling cleanFailure (Deferred). I tried a simple hack:
def cleanFailure(self):
"""Remove references to other objects, replacing them with strings.
"""
return self.__dict__ = self.__getstate__()
With that code in place, I got:
***** WITH cleanFailure ******
0.037 hpss request: [139767171196672] BzrDirFormat.initialize_ex_1.16
0.516 end: [139767171196672] 0.482s
Best times, 231ms vs 482ms. So __getstate__ is accounting for ~251ms in my testing. Which is pretty frickin huge. My immediate thought is that we should just avoid exceptions-as-return-codes when going through a Deferred.
Andrew, I believe you are correct about who is calling cleanFailure (Deferred). I tried a simple hack:
def cleanFailure(self):
self._ _dict__ = self.__getstate__()
"""Remove references to other objects, replacing them with strings.
"""
return
With that code in place, I got: initialize_ ex_1.16
***** WITH cleanFailure ******
0.037 hpss request: [139767171196672] BzrDirFormat.
0.516 end: [139767171196672] 0.482s
0.037 hpss request: [139767171196672] BzrDirFormat. initialize_ ex_1.16
0.768 end: [139767171196672] 0.736s
0.036 hpss request: [139767171196672] BzrDirFormat. initialize_ ex_1.16
0.523 end: [139767171196672] 0.490s
***** WITHOUT cleanFailure ****** initialize_ ex_1.16
0.035 hpss request: [140723835176704] BzrDirFormat.
0.424 end: [140723835176704] 0.393s
0.044 hpss request: [140723835176704] BzrDirFormat. initialize_ ex_1.16
0.275 end: [140723835176704] 0.236s
0.040 hpss request: [140723835176704] BzrDirFormat. initialize_ ex_1.16
0.321 end: [140723835176704] 0.285s
0.036 hpss request: [140723835176704] BzrDirFormat. initialize_ ex_1.16
0.264 end: [140723835176704] 0.231s
Best times, 231ms vs 482ms. So __getstate__ is accounting for ~251ms in my testing. Which is pretty frickin huge. My immediate thought is that we should just avoid exceptions- as-return- codes when going through a Deferred.