Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce number of allocations (closures, delegates) in TaskObservableExtensions.ToTask #293

Merged
merged 1 commit into from
Nov 14, 2016

Conversation

danielcweber
Copy link
Collaborator

We use the ToTask-extension a lot in our code and found it rather expensive wrt. object allocations. Looking into the code, I found that by implementing a custom IObserver, creation of closures and delegates can be avoided. I think even without anonymous lambdas, the code is still straghtforward and easy to read.

@shiftkey
Copy link
Contributor

@danielcweber this looks great! ✨ Introducing more of these into the Rx side to reduce allocations seems like a good idea for the next minor release.

@clairernovotny clairernovotny added this to the vNext milestone Nov 12, 2016
@shiftkey shiftkey merged commit 41eba4f into dotnet:master Nov 14, 2016
@danielcweber danielcweber deleted the OptimizeObservableToTask branch November 14, 2016 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants