This loop is iterating over the persisted ChildReference instances that have the same name, and it first counts the children with the same name. On each of these operations it has to go through all (or at least some) of the children with the same name. It would be much better to use `persisted.iterator(name)` that is far more efficient.