Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

NHibernate async implementation inefficient #3677

Unanswered
InlineAsm asked this question in Ideas
Discussion options

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.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /