Re:Show HN: Coros – A Modern C++ Library for Task Parallelism
by BenFrantzDale on Wednesday September 25, 2024 @09:08PM
(#41653491)
Have you compared perf with the reference implementation of the P2300 “Senders” proposal? https://github.com/NVIDIA/stdexec
[ Parent
| on HN ]
Re:Show HN: Coros – A Modern C++ Library for Task Parallelism
by mrkent27 on Wednesday September 25, 2024 @09:31PM
(#41653629)
I came here to comment the same thing. Senders/receivers have the added advantage of not allocating unlike coroutines that have to (usually) allocate on the heap.
Re:Show HN: Coros – A Modern C++ Library for Task Parallelism
by singledigits on Thursday September 26, 2024 @07:05AM
(#41656939)
I haven't compared performance with the P2300 proposal yet. It seems like it's trying to unify asynchronous and parallel execution for C++, which is much broader in scope than my library.
It's true that coroutines can avoid heap allocation, but I haven't tested when or if that happens in my implementation. From the papers, it's clear that certain conditions must be met for the compiler to optimize this. If you know of any good sources on this, please let me know.
I think it's definitely worth looking into this optimization and possibly using custom allocators for specific cases. I'll also compare performance with the proposal's implementation[1] to see the difference.
Thank you for your feedback.