Skip to content

Start Up Performance - Explore disabling allow-bean-definition-overriding true by default #13827

@codeconsole

Description

@codeconsole

Feature description

Start Up Time Performance can be severely impacted by the following code:

https://github.com/grails/grails-core/blob/1631e8640f4120c00c8c9241b67fb62d698a86ee/grails-core/src/main/groovy/grails/boot/GrailsApp.groovy#L104-L107

I think best practice would be to disable this by default as it hides a lot of duplicate initialization happening behind the scenes with Spring Boot.

For instance, in certain situations I have found when setAllowBeanDefinitionOverriding(true) is on, Spring Boot AutoConfigurations are happening that perform various configurations that are later not even used and completely overridden by Grails. The more dependencies that Spring Boot detects in the class path, the greater this penalty can become.

We should explore disabling this by default as it can always be turned on independently via config if required by the end user:

spring.main.allow-bean-definition-overriding=true

or

spring:
  main:
    allow-bean-definition-overriding: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions