Deep Copy vs creating new class object each time

273 views Asked by At

I'm working on a code base which is facing performance issues. There I saw Class ABC which is very huge (n number of data members, LIST of members of different classes) and have number of methods to perform operation for any object.

Further they have another Class XYZ which is creating objects of this ABC class (at least 10-15 objects - may be they have such business case). From code, what I understood is, that they need independent objects (deep copy). So I need your help to understand whether to implement deep copy by any mean like Serialization, Mannual or by using MemberwiseClone? Or let the code in the way it is now.

Can anyone comment on performance aspect of these two approaches?

Lang: C# (VS 2013)

0

There are 0 answers