Performance problem 1.2

From: Florian.Esk..i-de.com
Date: Thu Feb 02 2006 - 12:20:59 EST

  • Next message: Andrus Adamchik: "Re: Performance problem 1.2"

    Hello,

    during object creation we see significant performance diffrences between
    the cayenne 1.1 and cayenne 1.2 M10 version.

    The version 1.2. seems to us that it is 3 to 5 time slower than cayenne
    1.1.

    Our application fill the database with a great number of objects, so a
    import run needs with version 1.2.

    To show the problem we produce a sample code. The code needs for 1000
    objects with

    cayenne 1.1 3562 milliseconds
    and
    cayenne 1.2M10 17781 milliseconds

    But our application will produce in one loop step 40 objects so time will
    increase a little bit more.

    Profiling of the application show us that in version 1.2 most of the
    creation time is spent inside
    org.objectstyle.cayenne.util.IDUtil.pseudoUniqueByteSequence16()

    The call
    org.objectstyle.cayenne.access.DataContext.createAndRegisterNewObject(Class)
     is up to 6 time slower in the 1.2 implementation.

    Also it show us that for 40 commits the code 1.2 is 500 ms times slower
    than 1.1.
    This is for us also important, because we want do 7000 commits per business
    operation. So we will lost 1.20 minutes during commit.

    Our environment is
    DB: Database 10g Enterprise Edition Release 10.2.0.1.0
    JVM: 1.5.0_05-b05
    Operating System: Windows XP

    I hope this will help you to find a solution to speed up the cayenne 1.2
    code.

    Thanks

    florian

    Example code:

          public void testClientCommit() throws Exception
          {
                long start = System.currentTimeMillis();

                try
                {
                      DataContext context = DataContext.createDataContext();
                      Date date = new Date();

                      for (int i = 0; i < 1000; i++)
                      {
                            Client client = (Client)
    context.createAndRegisterNewObject(Client.class);

                            client.setCondition("i");
                            client.setCreated(date);
                            client.setCreatedBy("Test");
                            client.setName("Test Run"+i);

                            context.commitChanges();
                      }
                }
                catch (IllegalStateException e)
                {
                      e.printStackTrace();
                      throw e;
                }
                catch (CayenneRuntimeException e)
                {
                      e.printStackTrace();
                      throw e;
                }
                finally
                {
                      long end = System.currentTimeMillis();

                      System.out.println("testClientCommit needs "+ (end-start)
    + " ms!");
                }
          }



    This archive was generated by hypermail 2.0.0 : Thu Feb 02 2006 - 12:15:51 EST