6 Replies Latest reply on Jun 2, 2006 9:43 AM by jc7442

    Performance EJB2 v EJB3

    ihunter

      My work project is very hot on performance issues and we've implemented it using 2.1. I want to identify whether a 3.0 solution will help in this regard

      I've just spiked out a subset using EJB3 to do a speed comparison, and this indicates that EJB3 is slower than the EJB2 across all tests.

      Is this a surprise, or is this accepted and I need to wait for performance enhancements, OR is there something I can do about it in my configuration?

      Details:
      1) Standard 4.0.3SP1 out of the box, copying the default server to give me an independant servers.
      2) Platform is WinXP.
      3) I use a seperate (outside container) JUNIT harness.
      4) App. contains good mixture or read/write access
      5) Hypersonic DB
      6) For test results (msecs) at bottom.

      I have observed that in general, the EJB3 slams the CPU to 100% on both a WinXP and Windows 2000 machines

      Any information or advice gratefully recieved.

      [BTW: I am not in any way criticising here, I just need to know what can be expected so we can plan the project.]

      Many Thanks
      Ian Hunter

      EJB2 EJB3
      testAddingSingleCriticalAlarmNotification 20.4 28.1
      testUserCommentsTenAlarms 42.2 224.9
      testPollTenDeletedAlarms 53.1 71.8
      testPollTenChangedAlarms 53.1 151.7
      testPollTenNewlyCreatedAlarms 68.8 210.8
      testUserUnacknowledgesTenAlarmsAndWaitsForDelta 81.2 304.6
      testUserAcknowledgesTenAlarmsAndWaitsForDelta 92.1 336.1
      testUserDeletesTenAlarms 129.7 173.6
      testAddingTenCriticalAlarmNotifcationsToSameAlarmLifecycle 134.5 168.9
      testAddingCriticalAndClearedAlarmNotifcations 137.4 198.5
      testUserCommentsTenAlarmsAndWaitsForDelta 593.6 882.7
      testUserUnacknowledgesTenAlarmsAndWaitsForDelta 648.6 979.7
      testUserAcknowledgesTenAlarmsAndWaitsForDelta 662.6 923.4
      testUserDeletesTenAlarmsAndWaitsForDelta 675.1 746.7



        • 1. Re: Performance EJB2 v EJB3
          clebert.suconic

          Don't you want to contribute your tests?

          That would help IMO.

          • 2. Re: Performance EJB2 v EJB3
            clebert.suconic

            Also, you shouldn't take in consideratio any warm up times. Start measuring after some time after.

            On the beggining of these tests usually JIT kicks on, pooles are being filled, and that kind of thing.

            Also, make sure your test is fair to EJB2 and EJB3. they both have to be under the same caching circunstances. (usually for these scenarios it's better to not use caching at al).

            • 3. Re: Performance EJB2 v EJB3
              ihunter

              Hi Clebert,

              Thanks for the response.

              I can't publish the tests, they are very app. specific and probably very top secret ;-)

              However, they do cover a wide range of database activity and for us represent a 'relative' benchmark for comparing implementations.

              I understand your point about start up etc. To counter this, I ran the tests 10 times from cold for each config., and took the average.

              The caching strategy is an issue, and I will investigate this when I get back from hols.We set it specifically in the EJB2, I need to investigate the EJB3 situation.

              Again many thanks for your input.

              Ian Hunter

              • 4. Re: Performance EJB2 v EJB3
                epbernard

                do not test perf with HSQLDB if your target platform is not

                • 5. Re: Performance EJB2 v EJB3
                  bill.burke

                  Ian,

                  This is a entity heavy app I assume? I did some tests on Session beans and remote invocations are faster with EJB3 and local ejb3 interfaces a little bit slower.

                  You probably do not have your fetch strategies tuned appropriately(FETCH JOINs and EAGER/LAZY loading), nor are you doing any caching.

                  • 6. Re: Performance EJB2 v EJB3
                    jc7442

                    I've done some tests for ejb3 peristence (in the context of my application).

                    In most of the case results was good except in some specific cases. I had some problems when a lot of objects where retrieve in the same transaction and when during the transaction I perform queries (due to the auto-flush).

                    I had another problem: http://jira.jboss.com/jira/browse/EJBTHREE-326
                    Bug has not been closed yet. I have not tried to see it is is always true with more recent release.