test: Add direct exception passing for awaits for perf test #2653
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added direct exception passing case for coroutines. Exception are are passed directly after awaited future has been resolved with return_exception_ptr. This option can be a balance between of need frequent exception passing and convenience of using coroutines. The limitations of a such usage the return_exception_ptr cannot be used with void futures.
test iterations median mad min max allocs tasks inst cycles
chain.then_value 33390016 29.930ns 0.198ns 29.257ns 30.128ns 1.031 1.062 0.0 0.0
chain.await_value 21439200 46.201ns 0.055ns 46.146ns 46.681ns 1.063 1.094 0.0 0.0
chain.await_value_as_future 20355264 48.615ns 0.052ns 48.563ns 48.962ns 1.063 1.094 0.0 0.0
chain.then_exception 32634272 30.095ns 0.041ns 30.001ns 30.565ns 1.063 1.062 0.0 0.0
chain.await_exception 538272 1.813us 8.183ns 1.803us 1.834us 2.125 1.094 0.0 0.0
chain.await_exception_as_future 19190272 52.005ns 0.064ns 51.941ns 54.699ns 1.094 1.094 0.0 0.0