You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I was memory profiling our application and noticed large allocations in the NHibernate code path for retrieving the values from a resultset. In particular the code paths for HydrateAsync and ResolveIdentifierAsync in the AbstractType are using much memory. I think this is because the value from the AbstractType needs to be wrapped in a Task. This basically means NHibernate allocates twice as much memory when using the async methods like ListAsync() on a collection.
Would you consider using ValueTask for NHibernate 6.0? Many AbstractTypes don't support/use async at all. I tried to work around the inefficiency but I don't think it's possible to customize the loader. Another solution would be for the types to opt-in(out?) to the async behavior.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I was memory profiling our application and noticed large allocations in the NHibernate code path for retrieving the values from a resultset. In particular the code paths for HydrateAsync and ResolveIdentifierAsync in the AbstractType are using much memory. I think this is because the value from the AbstractType needs to be wrapped in a Task. This basically means NHibernate allocates twice as much memory when using the async methods like ListAsync() on a collection.
Would you consider using ValueTask for NHibernate 6.0? Many AbstractTypes don't support/use async at all. I tried to work around the inefficiency but I don't think it's possible to customize the loader. Another solution would be for the types to opt-in(out?) to the async behavior.
I would love to hear your thoughts on this.
Beta Was this translation helpful? Give feedback.
All reactions