High-performance Task and ValueTask computation expressions for F# with minimal overhead.
Ply is a high-performance Task Parallel Library (TPL) for F# that provides low-overhead Task and ValueTask abstractions comparable to C# async/await performance. It enables efficient asynchronous programming in F# with a focus on minimizing allocations and execution overhead, aiming to bring C#-like Task performance to F# with minimal abstraction overhead.
F# developers building high-performance asynchronous applications, particularly those who need to minimize garbage collection pressure and achieve performance parity with C# async/await.
Developers choose Ply over alternatives like TaskBuilder.fs because it offers performance on par with C# async/await, provides specialized builders for different return types and TFMs, and includes unsafe variants for zero-allocation scenarios when async locals or synchronization context changes are not needed.
High performance System.Threading.(Value)Task computation expressions for F#
Benchmarks in the README show Ply matches C# async/await in mean execution time (24.60 us vs 24.59 us) and outperforms TaskBuilder.fs, demonstrating its efficiency.
Offers builders like vtask with near-zero allocation and unsafe variants like uvtask for zero allocation when tasks are completed, reducing GC pressure as highlighted in the benchmarks.
Includes 8 specialized builders for Task, ValueTask, and their unit variants across TFMs like netstandard2.0 and netcoreapp2.1, allowing fine-grained optimization.
Provides unsafe builders that skip execution bubbles for maximum performance when async locals aren't used, giving developers direct control over safety versus speed trade-offs.
With 8 different builders and nuanced use cases detailed in the README table, developers must carefully select the right one, increasing cognitive load and risk of misuse.
Unsafe builders like uvtask skip execution bubbles, which can lead to incorrect behavior if async locals or synchronization contexts are modified, requiring deep async knowledge to use safely.
The README mentions an experimental branch and ongoing work to reduce allocations per bind, indicating some optimizations are still in flux and may cause instability.
http://hopac.github.io/Hopac/Hopac.html
F# computation expression builder for System.Threading.Tasks
Asynchronous sequences for F#
F# Async workflow <--> .NET Task/ValueTask easy seamless interoperability library.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.