Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add direct exception passing for awaits for perf test #2653

Closed
wants to merge 1 commit into from

Conversation

brain5lug
Copy link
Contributor

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

@brain5lug
Copy link
Contributor Author

@xemul Could you kindly have a look as an author or previous changes?

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                   31708032    31.415ns     0.177ns    31.175ns    31.592ns       1.031       1.062       320.1       118.6
chain.await_value                  20403392    49.203ns     0.048ns    48.914ns    49.260ns       1.063       1.094       456.9       186.1
chain.await_value_as_future        18967008    52.973ns     0.090ns    52.548ns    53.483ns       1.063       1.094       482.4       201.0
chain.then_exception               30921504    32.120ns     0.147ns    31.962ns    33.095ns       1.063       1.062       321.2       122.3
chain.await_exception                504704     1.975us     9.888ns     1.966us     1.989us       2.125       1.094     24397.8      7498.7
chain.await_exception_as_future    17931328    56.013ns     0.127ns    55.839ns    56.301ns       1.094       1.094       546.2       212.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant