When adding many child nodes to a node, better speed could be obtained by using a Capacity private property, to resize the internal children array few times instead of once per each added node.
Pros:
Speed when adding many many nodes
Cons:
The extra "Capacity" field adds 8 (or 16 in x64) bytes per node (more memory used) because an extra "Count" field should also be added, to remember the actual number of child nodes.
When adding many child nodes to a node, better speed could be obtained by using a Capacity private property, to resize the internal children array few times instead of once per each added node.
Pros:
Speed when adding many many nodes
Cons:
The extra "Capacity" field adds 8 (or 16 in x64) bytes per node (more memory used) because an extra "Count" field should also be added, to remember the actual number of child nodes.