-->
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.  [ 3 posts ] 
Author Message
 Post subject: Performance improvement?
PostPosted: Fri Jan 04, 2008 8:58 am 
Beginner
Beginner

Joined: Tue Mar 27, 2007 4:54 am
Posts: 47
Hibernate version:
1.2.1

The Get(IDataReader, x) method impl of the types in NHibernate.Type internally uses Convert.Xxx.

I might be wrong here, but I've always used IDataReader's GetXxx when converting data source values to a .net type becaused I thought it performed better.

If my thoughts are right, I guess this can make a decent improvement of the overall performance. At least when reading quite a lot number of objects.

Anyone who can confirm this? Why has nhibernate chosen the "Convert.Xxx" path when reading data?

Regards
Roger


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 3:07 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
I can't say I really know either way, but the following post on the microsoft forums seems to indicate that the data to be retreived by the GetXXX method must already be in the correct format as no conversion is performed.

http://forums.microsoft.com/MSDN/ShowPo ... 8&SiteID=1


Cheers,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 3:59 pm 
Beginner
Beginner

Joined: Tue Mar 27, 2007 4:54 am
Posts: 47
Thanks for your reply.

In our application we use guids as pk so my original post was primarly based on that type. Nhib's impl regarding Guid's Get() method first calls ToString() which, I guess, won't be needed nor used internally if relying on IDataReader's GetXxx impl.

I will investigate this further.

/R


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