Merging Parallel IAsyncEnumberables to Eliminate the Weakest Link #130741
Unanswered
toupswork
asked this question in
Show and tell
Replies: 3 comments 3 replies
|
I believe 'Concat'/'Append' is more likely to be adopted by .NET teams since there are Enumerable.Concat/Append things already. |
3 replies
|
I would definitely love something like this. We rolled our own (v1 was similar to this) but it would be great to have an official solution. The goal is to pull out whichever items are available first. |
0 replies
|
I think the BCL should start with a non-parallel P.S. I also have my own (non-parallel) efficient |
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.
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