-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Performance with inserts
PostPosted: Wed Nov 26, 2003 12:26 pm 
Newbie

Joined: Wed Nov 26, 2003 10:14 am
Posts: 1
Hi,

I tried to compare JDBC versus Hibernate using the performance test framework provided by the OJB project : (http://db.apache.org/ojb/performance.html#OtherTools).

I wrote HibernatePerfTest and HibernatePerfHandle classes, and changed a bit the JDBCPerfTest/Handle classes provided.

I changed the following things in the JDBC classes :

* isolate this class from any OJB Broker or Identity class

* use the auto-increment feature of mysql to have the same primary key generator for both tests

I use mysql 4.0.16. on a server.

I get the following results which I don't understand :

09:45:57,015 INFO SessionFactoryImpl:272 - Query language substitutions: {}
allocated memory after test: 23752 kb


========================================================
OJB PERFORMANCE TEST SUMMARY
10 concurrent threads, handle 2000 objects per thread
- performance mode
========================================================
API Period Total Insert Fetch Update Delete
[sec] [sec] [msec] [msec] [msec] [msec]
--------------------------------------------------------
JDBC 24.177 22.832 7322 187 8580 6743
Hiber 30.702 29.891 13438 214 8952 7286
========================================================



Why are the inserts so slow, what did i do wrong with my test set up, i am sure i am missing something, so if you can help me to get closer to the less than 10% overhead claimed...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 12:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Hibernate normally beats OJB comfortably in their own performance tests so I'm not sure what you did wrong. Probably just a basic error in you tests.


P.S. for fairness you should compare Hibernate vs. their ODMG API since the PB API does not offer full object persistence semantics. In this case we win by a really large margin.


Last edited by gavin on Wed Nov 26, 2003 12:34 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 12:32 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
oh in this case you are comparing vs. direct JDBC?

well, still not sure what you did wrong but I guarantee that overhead on inserts is tiny.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 2:11 pm 
Regular
Regular

Joined: Tue Sep 02, 2003 5:09 pm
Posts: 81
Location: Whitefish Montana
I don't know anything about the OJB tests, but using the getGeneratedKeys patch I submitted against DB2 running on a remote iSeries server I get close to double the performance for an insert with generated keys.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 9:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Ah possibly OJB is using getGeneratedKeys().

We will integrate this patch. I'm just not sure if we do it before 2.1 final, or wait for 2.1.1.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2003 12:56 pm 
Regular
Regular

Joined: Tue Sep 02, 2003 5:09 pm
Posts: 81
Location: Whitefish Montana
I downloaded OJB and it doesn't use getGeneratedKeys so I can't explain the difference. If I get some time, I may try a test of my own. There is no real rush to add the patch, I'm getting pretty good at merging but it is a free performance boost.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.