Merging IAsyncEnumberables #130741
Unanswered
toupswork
asked this question in
Show and tell
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
I am thrilled that the .NET team has decided to invest in adding IAsyncEnumberable support; i.e., linq-like extension methods, for now.
IAsyncEnumberable is very important to me because I write a lot of APIs, and I want to squeeze out every last drop of performance.
What I love about them is how much easier they make it to perform computation and I/O concurrently on the same request. Like while the hardware is buffering to RAM via DMA or MMIO activity while .NET waits for the IOCP, the CPU can perform computation like JSON serialization or other computation concurrently on the same request, while minimizing memory usage, sense data in ≈ data out.
One of the more important aspects is merging IAsyncEnumberables. For example, I just finished a project that involved producing UI endpoint that needed to aggregate and multiplex a dozen API calls along with a DB query; then I did custom JSON serialization with varying width arrays using a null presense mask to save payload size.
Anyway, here is a custom Merge method I wrote until the team can get around to writing a better one. This one demonstrated 2x performance over the one that is part of Ix.Net in my own testing.
All reactions