-
Notifications
You must be signed in to change notification settings - Fork 933
-
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.