-->
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.  [ 1 post ] 
Author Message
 Post subject: Flush(): reflection performance bottleneck
PostPosted: Fri Sep 08, 2006 3:49 pm 
Newbie

Joined: Tue Aug 01, 2006 12:42 pm
Posts: 11
NHibernate version: nhibernate-1.0.2.0

Hello All,

I've been doing some profiling of NH in a fairly performance heavy application I've been writing, and I'm finding that the method:
Code:
private void FlushEntity( object obj, EntityEntry entry )

is a bit of a performance bottleneck.

This is because it makes a call to grab the enitites current state:
Code:
persister.GetPropertyValues( obj )

which eventually uses reflection to pull out the property values, and reflection is relatively slow. I had hoped NH would only use reflection at startup, rather than at runtime (after startup).

I have already avoided using the default dirty checking (which does .Equals on properties) for performance reasons, and I was wondering if anyone could suggest a way of avoiding this reflection cost as well? Nothing jumps out to me from the source - it seems pretty straightforward (if we're not deleting the entity then make the GetPropertyValues() call which results in reflection).

Many thanks to all

Evan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.