1 Reply Latest reply on Jan 11, 2014 1:29 PM by Ralf Penners

    EJB vs. POJO - Performance

    Ralf Penners Newbie

      Hi,

       

      I noticed during a profiling process of my application, that the method invocation on an injected POJO is much faster, than the same method invoked on an EJB.

       

      A comparison of both call trees shows, that the one of the POJO is also much smaller than the one of the EJB.

       

      This fact sounds a little bit surprising to me, because I always thought, there wouldn't be a real difference between EJB and POJO in terms of performance.

       

      So did anybody of you realize something like this before, too? Or does anybody maybe have an explanation for this?

       

      Thank you!

        • 1. Re: EJB vs. POJO - Performance
          Ralf Penners Newbie

          The problem in this case was, that the invoked method was just a simple utility function, which was called very frequently.

           

          So the little overhead of an EJB, like for example the transaction management, had a negative effect on the performance of the application.

           

          In the end it was not an optimal application design to implement such a simple logic as an EJB instead of using a POJO or static class.