A performance-related optimization recommendation in PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors

See #23578.

Comment From: sbrannen

This is essentially a duplicate of #23530, which was withdrawn due to https://github.com/spring-projects/spring-framework/pull/23530#issuecomment-525803947.

@jhoeller, what are your thoughts on the matter?

Comment From: sbrannen

See also #23583

Comment From: jhoeller

This is unfortunately not equivalent, since BeanDefinitionRegistryPostProcessors may register further BeanDefinitionRegistryPostProcessors which we have to pick up still. A key reason to declared a post-processor as PriorityOrdered over Ordered is exactly the ability to register further post-processors. From that perspective, we have to retain our separate retrieval calls as distinct phases.