Skip to content

v2.1.0

Compare
Choose a tag to compare
@timcassell timcassell released this 20 Jun 03:30
· 1060 commits to master since this release

Enhancements:

  • Added AsyncLocal<T> support in async Promise functions.
    • Disabled by default, enable with Promise.Config.AsyncFlowExecutionContextEnabled = true.
  • Added ValueTask(<T>) interoperability.
    • Use promise.AsValueTask() or implicit cast ValueTask valueTask = promise;, or valueTask.ToPromise().
  • Added System.Threading.CancellationToken interoperability.
    • Use token.ToCancelationToken() to convert to Proto.Promises.CancelationToken, or token.ToCancellationToken() to convert to System.Threading.CancellationToken.

Optimizations:

  • 2x - 3x performance improvement for promises and cancelation tokens.
  • Reduced memory consumption of pending promises.

Misc:

  • Added netstandard2.1, netcoreapp2.1, and net5.0 build targets.

v2.0.2:

Method Registrations Pending Mean Error Allocated Survived
CancelationRegistration 10 ? 2,995.1 ns 20.43 ns - 320 B
AsyncAwait ? False 871.7 ns 1.79 ns - -
ContinueWith ? False 925.1 ns 1.20 ns - -
AsyncAwait ? True 6,478.1 ns 27.46 ns - 864 B
ContinueWith ? True 5,981.1 ns 32.83 ns - 560 B

v2.1.0:

Method Registrations Pending Mean Error Allocated Survived
CancelationRegistration 10 ? 920.3 ns 3.05 ns - 560 B
AsyncAwait ? False 344.4 ns 2.88 ns - -
ContinueWith ? False 483.0 ns 8.55 ns - -
AsyncAwait ? True 2,207.4 ns 7.98 ns - 736 B
ContinueWith ? True 2,574.5 ns 18.50 ns - 416 B