---------------test logic ---------------- 1. load some (n) number of objects in memory. 2. begin tranaction. 3. // do not do anything here. 4. commit. Then calculate the time consumed from step 2 and 4.
---------------- test code ----------------- List ps=new ArrayList(10010); for (int i=1000; i<2100; i++) { Parent p1=(Parent)session.load(Parent.class, new Long(i)); p1.getValues().size(); }
long startTime=System.currentTimeMillis(); Transaction tx=session.beginTransaction(); tx.commit(); long endTime=System.currentTimeMillis(); System.out.println("total time(in ms):"+(endTime-startTime));
-------------The performance metics--------- objects in memory time (in ms) for dirty check (3 experiments) 10000 741, 751,821 2000 200, 230, 230 1000 201, 191, 190, 100 30, 30, 30 1 10, 10, 10
jason
This is a lot better than your original statements to the list. You were originally quoting 1 second per object for transaction commit. Now you are doing 10000 in less than a second. Also, you would need to test to see how long just the .beginTransaction() and .commit() methods are taking, disregarding a dirty check. In other words, don't load any objects. Just do the last part of your code and see what you get.
Patrick
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel