Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8329733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:53:32+00:00 2026-06-09T01:53:32+00:00

Spring is taking about 5 to 10 seconds to configure it self, I am

  • 0

Spring is taking about 5 to 10 seconds to configure it self, I am using XML for infrastructure beans, and component scanning with annotations for everything else.

Does Spring JavaConfig eliminate the need for component scanning and all the reflection that happens to auto-wire beans by type? Has anyone seen an improvement in start-up time with JavaConfig?

My main concern is to speed up integration tests.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:53:34+00:00Added an answer on June 9, 2026 at 1:53 am

    If you continue using @ComponentScan, obviously you’ll see no improvement since the same scanning will occur, you are just enabling it using different format.

    On the other hand if you define all your beans using @Bean annotation and perform wiring manually by calling other @Bean methods – well, you’ll avoid component scanning cost, but this will bring you back to the ’90, except that you traded XML for Java (kind of improvement). Also remember that Java configuration has some cost as well. Each @Configuration class needs CGLIB proxy for reasons beyond the scope of this question.

    What I am typically doing is I use @Bean for infrastructure beans (that I don’t have control over) and @ComponentScan for everything else. Are you sure it is the component scanning that causes the delay and not Hibernate or some other third-party library bootup time? If it is scanning, well, you are trading startup time for developer comfort (no need to manually declare/wire everything manually).

    Of course there are ways to reduce component scanning time, mainly be carefully filtering packages/class names so that you only scan relevant classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Spring 3.0, ApplicationContext performs miscellaneous verification when creating beans and performing dependency injections.
From Spring Projects Issue Tracker Beans: public class JavaBean { private NestedBean nested; }
Got about a 400 MB .txt file here that is delimited by '|'. Using
I'm using the xml-object gem to process XML. Certain elements in the XML we
I have 2 servers, one with a Java app using Spring for DB connection
I am using Spring MVC 3.0 I have a guestbook.jsp page where I want
I´m using NHibernate 3 on a new desktop project. I've read about serialize the
I'm trying to optimize a query which is taking around 6 seconds to execute.
I need to send a string as parameter in UIButton selector. Taking global string
Spring MVC uses a DispatcherServlet to route control to an appropriate Controller. But where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.