2 Replies Latest reply on Jul 6, 2006 4:15 AM by Ben Walker

    JBOSS vs JUNIT Performance Issue

    Ben Walker Newbie

      Hi All,

      I have a J2EE application running on JBoss 4.0.2, with what appears to be a very serious performance issue:

      When I run the application whilst running in JBoss, a thread is invoked, which in turn uses a session bean to invoke a class on the business tier.

      When the performance of the the business class is measured (the time it takes from from start to finish) while running in JBoss, there is about a 65% overhead when compared to invoking the class directly from a JUnit test. This equates to the JUnit test running the business class approximately 3 times faster than the same class running in JBoss.

      The question is, is there a performance issue with JBoss running threads or/and EJBs?, or is there a performance issue with JBoss in general?

      Many thanks.

        • 1. Re: JBOSS vs JUNIT Performance Issue
          tony anecito Novice


          In order to determine what is good performance you need understand how much time it takes to get to the class through the EJB. I would like to know:

          1. How are you invoking the bean via a web service or using RMI?
          2. What happens if you run the test case via the EJB several times versus just once?
          3. What is the number of EJB's that are instantiated prior to calling JBoss?

          My 2cents says if you have simple business logic in your class regardless of who's container you use JBoss, WebLogic, WebSphere the class will always run much faster because you are not going through all those layers in a container to get to the class.

          Hope that helps.

          • 2. Re: JBOSS vs JUNIT Performance Issue
            Ben Walker Newbie

            Thanks tdanecito.

            To clarify:

            1. The bean is being invoked via RMI.
            2. If the test case is ran several times, there still isn't much difference in overhead.
            3. As far as I know, there is a call from a Stuts Action class to a thread, the thread then invokes the EJB, the EJB then makes the call to the business bean.

            As for the performance issue due to going through all the layers, I appreciate there will be a greater overhead, but I am taking performance timings for just the class itself - not how long it takes to get to it. So layers or not, it still takes longer for the classs to execute while inside the container.