Reputation: 812
Assume the existence of a graphical model instance which I want to clone it often for processing (a.k.a inference) purposes. I had several issues with poor performence with deep cloning till I used serialization. I was not believing in serialization (as another approach for cloning) till I tried it.
This brings me to the question: When it is advisable to serialize instead of deep clone? is there any threshold or tradeoff I should first examine in order to come up with the choice?
I am trying to comprehend this to advise my students on best practices in such situations.
Upvotes: 2
Views: 79
Reputation: 136062
Serialization is expensive because it needs to analize object's class. Cloning is always faster.
Upvotes: 1