I know some are real tired of this question - what can I expect for performance.
I have read all the other threads about "you can't judge apples to oranges!". I know that hibernate is an ORM tool and that you have to think of the development time savings rather than the execution time. I know that JDBC should always outperform hibernate.
But, I have read that I should expect decent performance, say 10% - 30% overhead running hibernate. What I found was that it was taking on average about 3x as long.
I wrote a simple program using three methods: JDBC, named query, and native query. The test simple selected 8 columns from a table and put them in a dto (pojo). Thats all. I then ran it against about 500 different records in the DB. There is no concurency, just a simple batch app. These are the results:
JDBC: 410 msecs ( I do run through the resultset and set to dto) Named Query: 1580 msecs Native Query: 1430 msecs
I thought I read in some cases that I could expect to get to 30% overhead which would be great in most cases. But 3x will cause me to have to use JDBC in a lot of apps.
Am I doing something wrong? Or is this what I should expect? I was wondering if the problem was due to JDBC PreparedStatment being much faster that the hibernate (is the preparedstatment cached at the DB?).
Thanks
|