I have a nested object with many nesting layers. Each object is basically containing list of some other types. I need to create a huge number of objects of these (almost 100 K) in short duration, and then discard them and then again create new. I wanted to understand whats the best way of pooling such kind of objects. Should I pool the whole object (the list member count for different objects may be different, or should I pool the last object E, though its very small ). Any suggestions are welcome.
ClassA
{
int a;
List<ClassB> mList;
}
ClassB
{
int b;
List<ClassC> mList;
}
ClassC
{
int b;
List<ClassD> mList;
}
ClassD
{
int b;
List<ClassE> mList;
}
ClassE
{
int a ;
int b;
List<int> bcd;
List<string> efg;
}