When persistent Lists get bigger, the PersistentBag.equalsSnapshot becomes significantly slows down Hibernate queries (with FlushMode.AUTO).
The implementation of this method calls countOccurrences and that calls ComponentType.isSame N*(2N) times where N is number of items in a collection. Since isSame uses reflection, it's quite slow.
I think there is quite simple optimization that can be made here. I will prepare a contribution for this.