Replies: 1 comment
-
You should probably create an issue for this in https://github.com/maca88/AsyncGenerator since most (all?) async code in NHibernate is generated by AsyncGenerator. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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