Closed kpu closed 3 years ago
If you've got an object that entails a memory allocation or other expensive construction/destruction, prefer to reuse it by pulling the object outside a loop. I see Timer, Histories and PCItem
Timer
Histories
PCItem
https://github.com/browsermt/mts/blob/338d5f76bce2c970c9f2b3c240b13b35ef4f733c/src/bergamot/batch_translator.cpp#L117-L136
https://github.com/browsermt/mts/blob/c46eee7190b6768abe583a5a84be6f468a8ccb43/src/bergamot/batch_translator.cpp#L104-L121
Closing.
If you've got an object that entails a memory allocation or other expensive construction/destruction, prefer to reuse it by pulling the object outside a loop. I see
Timer
,Histories
andPCItem
https://github.com/browsermt/mts/blob/338d5f76bce2c970c9f2b3c240b13b35ef4f733c/src/bergamot/batch_translator.cpp#L117-L136