-->
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.  [ 5 posts ] 
Author Message
 Post subject: ANTS Profiler results
PostPosted: Tue Nov 08, 2005 9:17 am 
Newbie

Joined: Tue Nov 08, 2005 8:55 am
Posts: 3
Hi,

I am building an ASP.Net application using nHibernate v 1.0.

I am attempting to resolve some performance issues throughout the application. There is a page, in particular, which is very slow. I ran ANTS Profiler on it and came up with this:

Namespace: NHibernate.Property
Method name: BasicGetter.Get(object target)
Time (sec.): 12.7316
Time with children (sec.): 12.8425
Hit count: 760693
Source file: BasicGetter.cs

The page in question is loading up three instances of a class (lazy loading enabled) which has approx 35 properties (15 of which are classes, 20 are strings). Additionally it is populating 3 dropdownlists which a country list (approx 240 items).

The BasicGetter.Get calls leaped out from the results, by its sheer magnitude. 760,000 method calls seems excessive given the size of the objects involved.

If feel the source of this issue is in our implementation/configuration of nHibernate, since doing a search on "BasicGetter" doesn't result in much, so it's obvious others are not running into this scenerio.

If you could point us in the right direction or have any ideas on what may causing this, it would be much appreciated.

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 10:58 am 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
Are you saying that the class being loaded has relationships to 15 other classes? If so, it sounds like your entire relation tree is being loaded. Perhaps using some lazy-loading on those relationships would reduce the DB calls to load the primary class being loaded.

I could also be way off. Where's that energy drink ... must ... get ... caffeine.

Wow, a quarter million selects in 12 seconds sounds pretty quick!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 7:11 am 
Newbie

Joined: Tue Nov 08, 2005 8:55 am
Posts: 3
k-dub,

Yes, the class has relationships with 15 other classes. I suspect the entire relation tree is being loaded. In the process of figuring out how to implement proxies and lazy loading.

On a side note, we were using a property accessor and have since changed it to a field accessor. This eliminated calls to BasicGetter.

Any pointers on using proxies and lazy loading?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 10:08 am 
Regular
Regular

Joined: Fri Jun 11, 2004 6:27 am
Posts: 81
Location: Yaroslavl, Russia
Roone wrote:
On a side note, we were using a property accessor and have since changed it to a field accessor. This eliminated calls to BasicGetter.


I bet now it's switched to FieldGetter. :)

_________________
Best,
Andrew Mayorov // BYTE-force


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 2:04 pm 
Regular
Regular

Joined: Tue May 24, 2005 12:55 pm
Posts: 56
Roone,

Enable lazyload on many-to-one by placing lazy="true" in the class node of the class you are referencing. This is different from placing the lazy="true" atrribute in the bag node. I believe the documentation covers this.


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