Hibernate

M

mtnguyen

Hi,

We have implemented a webabb that executes around 5000 reads upon
initial load.
We added hibernate to our application for different databases support
(SQLServer, MySQL) this was done
successfully and we are benifiting greatly from Hibernate for about a
year now. However, we now are looking at the
performance overhead that Hibernate adds. We are ready to accept an
overhead for the advantages we have gained but we
initially measured an load time that is 400% of the native sql code.

After some tweaking, we reduced the time to around 200% by setting the
"Auto-Commit" property to true.
We still feel that a 200% increase is too much of a price to pay. We
proceeded to measure more precisely
the native SQL calls versus the Hibernate calls and we have found the
following:
(we are under WinXP, Tomcat, MSSQL, hibernate 3, Microsoft JDBC
drivers, executing simple selects (no inter-entity mapping used for
hibernate))

1. Observing SQL profiler, we see that multiple SQL calls coming from
the native code implementation have the same timestamps while
every sql call coming from the hibernate implementation is "sequential"
(with carying delays of 10-20ms). We have not been able to
identify the reason for this difference in behavior.

2. Adding debug strings before and after the API calls to the database
(native and hibernate), we observe an almost
instantaneous execution of the native call while hibernate calls take
around 16ms. (we use the CreateQuery API). Is this a normal
hibernate parsing overhead?

Can anyone give us their opinions on the performance differences we are
observing?

Questions:

a. Is the transaction manager a factor in our issues ? (We defined
JDBCTansaction in our config file)
b. Is the connection manager a factor in our issues? ( We are using
c3p0)
c. Is this a normal overall performance overhead?




Thanks,
Minh
 
O

Oliver Wong

Hi,

We have implemented a webabb that executes around 5000 reads upon
initial load.
We added hibernate to our application for different databases support
(SQLServer, MySQL) this was done
successfully and we are benifiting greatly from Hibernate for about a
year now. However, we now are looking at the
performance overhead that Hibernate adds. We are ready to accept an
overhead for the advantages we have gained but we
initially measured an load time that is 400% of the native sql code.

After some tweaking, we reduced the time to around 200% by setting the
"Auto-Commit" property to true.
We still feel that a 200% increase is too much of a price to pay. We
proceeded to measure more precisely
the native SQL calls versus the Hibernate calls and we have found the
following:
(we are under WinXP, Tomcat, MSSQL, hibernate 3, Microsoft JDBC
drivers, executing simple selects (no inter-entity mapping used for
hibernate))

1. Observing SQL profiler, we see that multiple SQL calls coming from
the native code implementation have the same timestamps while
every sql call coming from the hibernate implementation is "sequential"
(with carying delays of 10-20ms). We have not been able to
identify the reason for this difference in behavior.

2. Adding debug strings before and after the API calls to the database
(native and hibernate), we observe an almost
instantaneous execution of the native call while hibernate calls take
around 16ms. (we use the CreateQuery API). Is this a normal
hibernate parsing overhead?

Can anyone give us their opinions on the performance differences we are
observing?

Questions:

a. Is the transaction manager a factor in our issues ? (We defined
JDBCTansaction in our config file)
b. Is the connection manager a factor in our issues? ( We are using
c3p0)
c. Is this a normal overall performance overhead?

This question sounds very specific to Hibernate, and only marginally
related to Java. As such, you'll probably receive better responces in
Hibernate's own forums, which the developers of Hibernate frequently read
and post to.

Note that they have some rules about "how to ask for help", and they get
upset if you disobey them.

The rules:
http://hibernate.org/160.html

The forum:
http://forum.hibernate.org/

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top