-->
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.  [ 4 posts ] 
Author Message
 Post subject: Performance of ResultSet.get*(String)
PostPosted: Mon Oct 13, 2003 3:59 pm 
Newbie

Joined: Mon Sep 08, 2003 4:04 am
Posts: 4
Hello,

I was tempted to post this to the "Performance-Challenge", but the problem is so general that I think I must be missing something.

I've been testing Hibernate using the TPC-W benchmark (http://www.tpc.org), specifically, against the JDBC-Servlets implementation on jmob (http://jmob.objectweb.org/tpcw.html).

I'm using hibernate 2.0.3 and mySQL 4.0.15 here, with the Connector/J driver (it could be that the problem is specific to this driver, but even so, the most common opensource O/R mapper should work with the most common driver for the most common opensource DB, shouldn't it?)

Using JProbe to analyse the performance, I see that about 30%
of the time is spent in ResultSet.findColumn(String), which is called from ResultSet.get*(String). The problem is, getting a named column from a ResultSet is much more expensive than getting a numbered column. That is, ResultSet.getString("title") is slower than ResultSet.getString(1). Worse, since this extra work is associated only with a particular result set, the same overhead is incurred everytime an object is loaded. When we load a bunch of objects using JDBC that give the number of the column, we will always be faster than hibernate, since hibernate uses the name of the returned field.

With this information, it's pretty easy to generate an example where
jdbc outperforms hibernate. If needed, I can send the code I am using. I'm not sure I can post it, as I'm not the holder of the copyright (everything is GPL'd).

Am I missing something here, or is this a performance problem with Hibernate?

Best Regards,

Ron


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2003 7:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
net.sf.hibernate.test.PerformanceTest does not show this to be a problem, even on MySQL.

If you can really demonstrate such a big difference in performance, I would certainly like to know about it. (I'm not sure it quite qualifies for the $100, 'cos I say "must be reproduceable on >1 platform".)

So, send me something, since this is a different result to my tests.....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 3:44 am 
Newbie

Joined: Mon Sep 08, 2003 4:04 am
Posts: 4
Hi,

I'm not interested in the $100, I'm more interested in helping to improve Hibernate. I am writing an article for a German magazine that uses the TPC-W benchmark to measure the performance of various software architectures, and would like to verify Hibernate's claim of being "very high performance".

My code base is too large for posting, I can send you an archive of the code, complete with scripts to populate the database, but I need an e-mail address to which to send it.

Ron


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 8:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
send it to gavin@hibernate.org

TIA


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.