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