views:

79

answers:

1

how to measure performance in hibernate? I want to know that how much time hibernate takes to execute a query?

A: 

Do you mean literally the query or the query + the munging of the data into Java objects?

Either way, using a profiling tool such as JProbe is probably the way to go if you want to be scientific. You don't necesserily need to spend money, there are some free tools in Eclipse too.

In the simplest case, just adding a few print statements around the code in question can be enough, if the the thing you are measuring is the dominant processing.

Getting really thorough in performance analysis takes great care. Often you need to run many repeats of the thing you're testing in order to make sure you don't get mislead by initial overheads (such as opening the connection to the Db). And don't forget that the database and performance is likely to be critical, hibernate itself can't do anything about a badly tuned database.

djna
Thanks to reply. Do you any specific free tools or eclipse plugin for performance analysis in hibernate?
kandarp
Well I saw http://www.eclipse.org/tptp/ when I googled, never used it myself, but surely it's worth a look?
djna
thanks brother. i will check it out.
kandarp