Announcement Announcement Module
No announcement yet.
Jobs registration startup time increased with Spring 3 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jobs registration startup time increased with Spring 3


    We recently switched our application to Spring 3.0.4. We are using Spring batch 2.1.3

    What I've noticed is a big increase of the application startup time (28 sec with 2.5.7 and 43 sec with 3.0.4).

    Has anybody experienced similar slow down? Any idea how this could be improved?


  • #2
    I haven't heard of any problems with Batch, but there are similar issues with some apps loading XSD and DTD docs from the internet instead of the local jars. You could confirm if this is the problem by sniffing the network traffic as your app starts up (or maybe just shutting off the internet and see what happens).


    • #3
      Another suggestion: if you are running on Unix there have been reports of slow start up when using Spring Security because of OS-level calls to generate random numbers. Are you using Spring Security on unix? Can you try the same test on Windows?


      • #4
        Thanks for the heads up Dave. I am on windows and the company is behind an HTTP proxy that is not configured on my box (I mean for Java-based apps).

        I have scheduled a profiling session tomorrow and I'll keep you posted.


        • #5
          I have found something that might be interesting. It's not directly related to batch and I am ok to report it to the core framework directly.

          I have ran a profiling session with our batch module and a simple test case. The test is empty but it bootstraps the container that holds 22 job definitions.

          The yourkit snapshot are available if you're interested but it all boils down to registerItemListeners and registerStepListeners. With Spring 2.5, the call stack is fast but something changed in 3.0. The call to java.lang.class went from 14.000 invocations to 1.3 million !

          See the call stack for the registerItemListeners

          Spring 2.5:
          Spring 3:


          • #6
            I don't see the 1.3 million number anywhere, but I can see the difference between Spring 3 and 2.5 (the implementation of AnnotationUtils.findAnnotation(Method,Class) changed). Can you raise an issue against Spring Core and we can take it from there. It is possible we could do some caching.


            • #7
              Here you go

              (1,17M on the 1,30M are for the item/step registration process)

              And the issue:


              • #8
                An interesting outcome of my profiling session shows that the checks for annotations seems to be duplicated.

                I haven't looked precisely at the code but maybe you'll find the information useful. You can find more information in SPR-7630.