timcassell / ProtoPromise

Robust and efficient library for management of asynchronous operations in C#/.Net.
MIT License
136 stars 13 forks source link

Optimize async Promise #414

Closed timcassell closed 3 months ago

timcassell commented 3 months ago

Trade-off increased memory to remove a branch, resulting in faster synchronous completions (asynchronous completion times are negligible).

develop

Method Pending Mean Allocated Survived
AsyncAwait False 334.0 ns - -
AsyncAwait True 1,602.5 ns - 624 B

PR

Method Pending Mean Allocated Survived
AsyncAwait False 304.0 ns - -
AsyncAwait True 1,611.2 ns - 648 B