For which beans in spring does it make sense to configure a lazy boot?

    1 answer 1

    If you have components that are “expensive” to instantiate and that are needed only in rare use cases, then it makes sense to mark them as “lazy”. For example, the component provides the launch of the Large Hadron Collider.

    • but in this case, the processing time of the first request operating with this bin will significantly increase if we are talking about a web application and a singleton scope? - vados
    • It is increased by the time required for component instantiation. But if you rarely use this component, then for other requests, the time will decrease. In a web application, a lazy download in my opinion does not make sense. - Mikhail Vaysman