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...