v2.1.0
Enhancements:
- Added
AsyncLocal<T>
support inasync Promise
functions.- Disabled by default, enable with
Promise.Config.AsyncFlowExecutionContextEnabled = true
.
- Disabled by default, enable with
- Added
ValueTask(<T>)
interoperability.- Use
promise.AsValueTask()
or implicit castValueTask valueTask = promise;
, orvalueTask.ToPromise()
.
- Use
- Added
System.Threading.CancellationToken
interoperability.- Use
token.ToCancelationToken()
to convert toProto.Promises.CancelationToken
, ortoken.ToCancellationToken()
to convert toSystem.Threading.CancellationToken
.
- Use
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 |