* Revert "Revert "Improve performance of collectAllElements (#68065)" (#68207)" This reverts commit 46ff57d6. * use fewer elements for benchmark