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

Add timeout operator #287

Merged
merged 8 commits into from
Nov 2, 2022
Merged

Add timeout operator #287

merged 8 commits into from
Nov 2, 2022

Conversation

victimsnino
Copy link
Owner

Resolves #286

@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Merging #287 (6ceda27) into main (2ae50e7) will decrease coverage by 0.04%.
The diff coverage is 96.55%.

@@            Coverage Diff             @@
##             main     #287      +/-   ##
==========================================
- Coverage   98.63%   98.59%   -0.05%     
==========================================
  Files         105      107       +2     
  Lines        1467     1496      +29     
==========================================
+ Hits         1447     1475      +28     
- Misses         20       21       +1     
Impacted Files Coverage Δ
src/rpp/rpp/observables/interface_observable.hpp 100.00% <ø> (ø)
src/rpp/rpp/operators/timeout.hpp 96.15% <96.15%> (ø)
src/rpp/rpp/operators/fwd/timeout.hpp 100.00% <100.00%> (ø)
src/rpp/rpp/schedulers/details/worker.hpp 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2022

BENCHMARK RESULTS (AUTOGENERATED)

ci-ubuntu-clang

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.34ns 0.32506 1.03 0.33ns
Dynamic observable construction 29.20ns 30.0954 0.97 24.27ns
Specific observable construction + as_dynamic 29.15ns 30.0351 0.97 24.16ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 88.86ns 105.42 0.84 290.77ns
Specific observable lift dynamic observer 111.65ns 133.682 0.84 306.85ns
Dynamic observable lift specific observer 170.01ns 183.376 0.93 335.45ns
Dynamic observable lift dynamic observer 177.28ns 202.233 0.88 321.56ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 57.94ns 74.6762 0.78 290.73ns
Specific observable subscribe dynamic observer 71.27ns 77.0957 0.92 295.01ns
Dynamic observable subscribe specific observer 127.61ns 140.036 0.91 330.67ns
Dynamic observable subscribe dynamic observer 123.93ns 159.015 0.78 314.04ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 58.09ns 64.6849 0.90 287.25ns
Dynamic observable subscribe lambda 124.04ns 131.859 0.94 323.62ns
Specific observable subscribe lambda without subscription 58.07ns 64.7068 0.90 288.62ns
Dynamic observable subscribe lambda without subscription 124.34ns 134.402 0.93 328.08ns
Specific observable subscribe specific subscriber 27.93ns 32.639 0.86 224.31ns
Dynamic observable subscribe specific subscriber 88.57ns 89.8663 0.99 269.25ns
Specific observable subscribe dynamic observer 27.81ns 33.3988 0.83 238.67ns
Dynamic observable subscribe dynamic observer 77.58ns 92.8311 0.84 258.41ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.33ns 0.365854 0.91 0.34ns
Dynamic observer construction 29.19ns 29.7256 0.98 21.49ns
Specific observer construction + as_dynamic 29.36ns 33.0315 0.89 21.33ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.710108 0.94 0.67ns
Dynamic observer OnNext 2.01ns 2.09704 0.96 2.34ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 34.87ns 35.4824 0.98 64.54ns
Make copy of subscriber 16.77ns 21.2406 0.79 4.69ns
Transform subsriber to dynamic 43.59ns 48.5076 0.90 26.36ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 34.83ns 38.1346 0.91 52.52ns
composite_subscription add 47.36ns 58.793 0.81 90.58ns
composite_subscription unsubscribe 44.09ns 49.3086 0.89 23.49ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 247.76ns 298.305 0.83 1844.08ns
sending of values from observable via buffer to subscriber 5.36ns 10.8759 0.49 27.24ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 254.63ns 296.756 0.86 523.39ns
long stateful chain creation + subscribe 376.28ns 430.671 0.87 1570.42ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 860.20ns 987.344 0.87 940.35ns
sending of values from observable via combine_latest to subscriber 27.40ns 33.8351 0.81 1.75ns

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 1866.55ns 2186.81 0.85 3290.04ns
concat_with 2168.67ns 2483.61 0.87 3732.17ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 110.93ns 122.782 0.90 253.42ns
sending of values from observable via distinct_until_changed to subscriber 2.68ns 2.9764 0.90 2.34ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 124.31ns 156.913 0.79 583.43ns
sending of values from observable via first to subscriber 0.67ns 0.579328 1.16 0.67ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 61.71ns 75.3907 0.82 616.76ns
error 111.93ns 121.792 0.92 746.08ns
never 28.82ns 35.5697 0.81 250.34ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 79.97ns 118.186 0.68 656.34ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.34ns 0.669103 2.00 113.37ns
re-schedule 10 times 11.54ns 10.6556 1.08 143.15ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 64.66ns 74.1443 0.87 631.61ns
just send variadic 94.54ns 158.039 0.60 738.81ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 168.43ns 193.473 0.87 356.29ns
sending of values from observable via last to subscriber 2.11ns 3.42128 0.62 1.67ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 68.46ns 78.287 0.87 246.27ns
sending of values from observable via map to subscriber 1.34ns 0.912247 1.47 1.51ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 1811.84ns 2038.22 0.89 3436.94ns
merge_with 2109.22ns 2418.03 0.87 3573.26ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 423.56ns 459.829 0.92 2646.95ns
sending of values from observable via observe_on to subscriber 61.35ns 65.137 0.94 202.69ns

on_error_resume_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_error_resume_next construction from observable via dot + subscribe 422.02ns 505.087 0.84 1053.96ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 25.10ns 26.1878 0.96 10.67ns
on_error 0.67ns 0.654009 1.03 19.17ns
on_completed 0.67ns 0.828633 0.81 0.67ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 187.30ns 208.552 0.90 182.97ns
get_observable 26.44ns 32.1471 0.82 50.18ns
get_subscriber 60.75ns 61.6486 0.99 13.21ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 3909.55ns 4632.34 0.84 3026.13ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 101.77ns 113.907 0.89 294.56ns
sending of values from observable via scan to subscriber 2.01ns 2.73791 0.73 2.01ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.02ns 2.73283 0.74 .
mutex lock increment 18.08ns 22.0746 0.82 .
spin-lock increment 9.04ns 12.3506 0.73 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 98.80ns 115.92 0.85 475.27ns
sending of values from observable via skip to subscriber 2.34ns 4.34633 0.54 1.78ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 2195.10ns 2644.02 0.83 2831.70ns
sending of values from observable via switch_on_next to subscriber 566.71ns 633.807 0.89 649.76ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 169.42ns 210.983 0.80 489.86ns
sending of values from observable via take to subscriber 2.35ns 2.50303 0.94 3.37ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 212.66ns 256.682 0.83 525.60ns
sending of values from observable via take_last to subscriber 2.69ns 4.19017 0.64 3.79ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1028.29ns 1217.89 0.84 1167.61ns
sending of values from observable via take_until to subscriber 9.03ns 12.6961 0.71 1.84ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 866.59ns None . 17517.40ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 55.90ns None . 16605.80ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 11.43ns 13.2574 0.86 161.79ns
re-schedule 10 times 32.52ns 44.7886 0.73 188.24ns
recursively schedule 10 times 1387.15ns 1596.49 0.87 8169.69ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 2000.46ns 2280.1 0.88 3122.63ns
sending of values from observable via window to subscriber 549.13ns 707.11 0.78 364.75ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1012.01ns 1215.27 0.83 1176.17ns
sending of values from observable via with_latest_from to subscriber 27.03ns 30.1597 0.90 3.02ns

ci-ubuntu-gcc

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.33ns 0.405931 0.83 0.34ns
Dynamic observable construction 31.60ns 37.8163 0.84 23.49ns
Specific observable construction + as_dynamic 31.49ns 37.8035 0.83 23.65ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 97.92ns 111.932 0.87 340.71ns
Specific observable lift dynamic observer 127.09ns 147.306 0.86 353.03ns
Dynamic observable lift specific observer 181.62ns 198.419 0.92 406.91ns
Dynamic observable lift dynamic observer 192.12ns 232.343 0.83 371.74ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 60.84ns 74.9256 0.81 331.90ns
Specific observable subscribe dynamic observer 77.76ns 92.9943 0.84 338.14ns
Dynamic observable subscribe specific observer 131.14ns 147.476 0.89 377.85ns
Dynamic observable subscribe dynamic observer 127.29ns 152.463 0.83 351.33ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 61.62ns 72.4813 0.85 332.52ns
Dynamic observable subscribe lambda 130.99ns 157.321 0.83 374.47ns
Specific observable subscribe lambda without subscription 61.58ns 71.6302 0.86 337.44ns
Dynamic observable subscribe lambda without subscription 131.29ns 156.952 0.84 375.72ns
Specific observable subscribe specific subscriber 30.51ns 34.5288 0.88 270.21ns
Dynamic observable subscribe specific subscriber 97.46ns 117.931 0.83 318.46ns
Specific observable subscribe dynamic observer 30.48ns 36.4824 0.84 277.61ns
Dynamic observable subscribe dynamic observer 86.56ns 99.5 0.87 291.08ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.33ns 0.402267 0.83 0.33ns
Dynamic observer construction 31.53ns 37.7961 0.83 21.07ns
Specific observer construction + as_dynamic 31.56ns 37.3725 0.84 20.46ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.33ns 0.403304 0.83 0.34ns
Dynamic observer OnNext 2.01ns 2.41763 0.83 1.77ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 34.66ns 41.3938 0.84 63.91ns
Make copy of subscriber 16.74ns 20.1755 0.83 4.48ns
Transform subsriber to dynamic 44.72ns 51.2983 0.87 25.68ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 34.66ns 40.9629 0.85 58.81ns
composite_subscription add 49.56ns 57.9825 0.85 94.30ns
composite_subscription unsubscribe 41.60ns 50.2199 0.83 21.61ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 235.05ns 283.091 0.83 1954.53ns
sending of values from observable via buffer to subscriber 6.06ns 7.62014 0.80 32.04ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 286.23ns 303.116 0.94 698.49ns
long stateful chain creation + subscribe 425.26ns 489.933 0.87 1638.16ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 917.91ns 1094.75 0.84 1133.29ns
sending of values from observable via combine_latest to subscriber 28.13ns 32.967 0.85 2.35ns

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 1900.16ns 2273.5 0.84 3601.84ns
concat_with 2256.11ns 2588.5 0.87 4004.82ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 119.77ns 145.121 0.83 360.56ns
sending of values from observable via distinct_until_changed to subscriber 2.91ns 2.83226 1.03 2.35ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 137.70ns 166.35 0.83 706.69ns
sending of values from observable via first to subscriber 1.34ns 1.23025 1.09 1.01ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 66.96ns 80.6234 0.83 735.37ns
error 116.61ns 136.018 0.86 837.18ns
never 32.25ns 36.5464 0.88 282.07ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 85.06ns 95.8551 0.89 761.89ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.34ns 1.46735 0.91 129.29ns
re-schedule 10 times 15.39ns 24.8876 0.62 167.72ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 70.35ns 85.0621 0.83 757.31ns
just send variadic 109.52ns 138.526 0.79 837.12ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 176.29ns 205.173 0.86 448.86ns
sending of values from observable via last to subscriber 2.35ns 2.45554 0.96 1.34ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 82.11ns 93.538 0.88 349.68ns
sending of values from observable via map to subscriber 0.76ns 1.57908 0.48 2.86ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 1863.28ns 2230.19 0.84 3735.06ns
merge_with 2218.11ns 2578.07 0.86 4060.19ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 469.17ns 535.718 0.88 2860.80ns
sending of values from observable via observe_on to subscriber 63.69ns 85.5063 0.74 240.02ns

on_error_resume_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_error_resume_next construction from observable via dot + subscribe 437.98ns 521.509 0.84 1002.17ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 22.42ns 26.9678 0.83 10.94ns
on_error 0.67ns 0.795785 0.85 16.83ns
on_completed 0.67ns 1.59101 0.42 0.67ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 203.66ns 262.031 0.78 177.65ns
get_observable 29.45ns 35.373 0.83 48.56ns
get_subscriber 57.45ns 68.8386 0.83 23.13ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 4157.57ns 5038.5 0.83 3199.25ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 115.67ns 134.609 0.86 393.97ns
sending of values from observable via scan to subscriber 2.65ns 1.77698 1.49 1.68ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.00ns 2.32227 0.86 .
mutex lock increment 18.09ns 20.3141 0.89 .
spin-lock increment 9.05ns 11.2293 0.81 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 114.42ns 138.452 0.83 538.26ns
sending of values from observable via skip to subscriber 2.69ns 2.77016 0.97 2.35ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 2331.65ns 2627.3 0.89 4177.64ns
sending of values from observable via switch_on_next to subscriber 597.91ns 729.914 0.82 1101.02ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 171.83ns 189.596 0.91 595.23ns
sending of values from observable via take to subscriber 3.51ns 4.03075 0.87 3.48ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 206.33ns 244.242 0.84 645.65ns
sending of values from observable via take_last to subscriber 3.37ns 3.34896 1.01 6.15ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1066.23ns 1300.01 0.82 1581.33ns
sending of values from observable via take_until to subscriber 10.24ns 12.7327 0.80 1.79ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 940.25ns None . 16352.10ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 60.34ns None . 14843.40ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 21.02ns 25.1234 0.84 183.85ns
re-schedule 10 times 50.04ns 60.6078 0.83 221.29ns
recursively schedule 10 times 1442.07ns 1601.95 0.90 8662.94ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 2124.46ns 2520.76 0.84 3270.86ns
sending of values from observable via window to subscriber 590.19ns 711.358 0.83 423.78ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1091.10ns 1193.21 0.91 1432.36ns
sending of values from observable via with_latest_from to subscriber 26.78ns 34.6258 0.77 4.39ns

ci-windows

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 1.51ns 1.50355 1.01 0.60ns
Dynamic observable construction 67.85ns 79.6962 0.85 119.47ns
Specific observable construction + as_dynamic 73.06ns 79.8282 0.92 108.74ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 124.86ns 145.204 0.86 1222.37ns
Specific observable lift dynamic observer 172.65ns 180.683 0.96 1101.50ns
Dynamic observable lift specific observer 250.22ns 283.659 0.88 1414.33ns
Dynamic observable lift dynamic observer 222.77ns 237.351 0.94 1265.61ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 106.47ns 110.982 0.96 1041.45ns
Specific observable subscribe dynamic observer 120.94ns 130.351 0.93 1115.40ns
Dynamic observable subscribe specific observer 278.11ns 227.191 1.22 1262.06ns
Dynamic observable subscribe dynamic observer 179.09ns 177.545 1.01 1200.75ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 108.10ns 111.315 0.97 1035.36ns
Dynamic observable subscribe lambda 210.29ns 227.027 0.93 1313.67ns
Specific observable subscribe lambda without subscription 122.33ns 111.319 1.10 1173.45ns
Dynamic observable subscribe lambda without subscription 197.00ns 227.554 0.87 1279.22ns
Specific observable subscribe specific subscriber 27.11ns 30.8 0.88 826.69ns
Dynamic observable subscribe specific subscriber 142.69ns 146.365 0.97 986.62ns
Specific observable subscribe dynamic observer 30.49ns 30.7757 0.99 830.62ns
Dynamic observable subscribe dynamic observer 73.99ns 87.4726 0.85 915.62ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 1.38ns 1.50572 0.92 1.68ns
Dynamic observer construction 80.39ns 81.4 0.99 102.83ns
Specific observer construction + as_dynamic 75.52ns 81.2336 0.93 113.60ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.68ns 0.670353 1.02 0.59ns
Dynamic observer OnNext 1.81ns 2.0094 0.90 1.95ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 85.83ns 84.1242 1.02 311.21ns
Make copy of subscriber 14.60ns 17.2476 0.85 31.78ns
Transform subsriber to dynamic 85.36ns 96.5602 0.88 132.19ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 95.54ns 84.2226 1.13 452.50ns
composite_subscription add 63.23ns 71.131 0.89 150.54ns
composite_subscription unsubscribe 62.34ns 64.8813 0.96 106.82ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 317.79ns 351.354 0.90 3987.83ns
sending of values from observable via buffer to subscriber 5.80ns 7.09153 0.82 92.61ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 254.55ns 269.277 0.95 1640.92ns
long stateful chain creation + subscribe 630.11ns 667.333 0.94 2726.00ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1603.60ns 1644.07 0.98 2649.75ns
sending of values from observable via combine_latest to subscriber 43.36ns 47.2189 0.92 4.08ns

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 2736.20ns 3225.33 0.85 10918.00ns
concat_with 2927.00ns 3875.62 0.76 10334.00ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 188.26ns 183.56 1.03 1021.50ns
sending of values from observable via distinct_until_changed to subscriber 3.18ns 3.54878 0.90 3.55ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 125.63ns 128.461 0.98 2604.25ns
sending of values from observable via first to subscriber 2.16ns 2.36083 0.92 1.62ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 69.72ns 68.1395 1.02 2963.20ns
error 116.16ns 113.196 1.03 2269.78ns
never 30.95ns 30.8386 1.00 834.05ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 117.92ns 151.013 0.78 2291.50ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.98ns 1.76072 1.12 382.75ns
re-schedule 10 times 95.08ns 102.137 0.93 392.96ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 62.07ns 68.2901 0.91 2328.30ns
just send variadic 99.92ns 101.849 0.98 2242.90ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 205.56ns 223.04 0.92 1326.12ns
sending of values from observable via last to subscriber 2.77ns 3.19931 0.86 2.97ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 89.34ns 88.0136 1.02 864.12ns
sending of values from observable via map to subscriber 3.85ns 4.01559 0.96 6.31ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 3169.00ns 3010.5 1.05 9916.00ns
merge_with 3196.25ns 3691.5 0.87 11330.50ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 601.77ns 642.641 0.94 5838.75ns
sending of values from observable via observe_on to subscriber 53.06ns 63.7732 0.83 716.85ns

on_error_resume_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_error_resume_next construction from observable via dot + subscribe 575.28ns 634.35 0.91 1579.83ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 19.84ns 19.8402 1.00 33.54ns
on_error 2.54ns 2.72319 0.93 18.12ns
on_completed 2.86ns 2.2798 1.26 1.18ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 337.65ns 353.203 0.96 677.61ns
get_observable 22.72ns 26.0661 0.87 182.57ns
get_subscriber 48.07ns 50.2096 0.96 85.73ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 5817.20ns 6824.5 0.85 10555.70ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 203.47ns 182.564 1.11 1245.15ns
sending of values from observable via scan to subscriber 4.98ns 6.15678 0.81 9.68ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 1.74ns 1.88211 0.92 .
mutex lock increment 27.03ns 25.8806 1.04 .
spin-lock increment 8.53ns 9.03363 0.94 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 165.17ns 177.469 0.93 1717.69ns
sending of values from observable via skip to subscriber 3.88ns 3.47602 1.12 4.86ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 3308.71ns 3769.38 0.88 10423.50ns
sending of values from observable via switch_on_next to subscriber 986.47ns 868.742 1.14 3511.33ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 221.72ns 224.424 0.99 2197.56ns
sending of values from observable via take to subscriber 4.84ns 5.77979 0.84 5.47ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 294.14ns 321.764 0.91 2432.00ns
sending of values from observable via take_last to subscriber 4.04ns 4.2263 0.95 19.86ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1634.50ns 1694.35 0.96 4689.00ns
sending of values from observable via take_until to subscriber 11.64ns 11.5467 1.01 4.58ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1404.65ns None . 5565.25ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 62.88ns None . 1297.93ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 19.28ns 20.3858 0.95 594.48ns
re-schedule 10 times 120.55ns 121.569 0.99 613.95ns
recursively schedule 10 times 2519.80ns 2584.45 0.97 17411.00ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 2566.56ns 2931.67 0.88 8561.00ns
sending of values from observable via window to subscriber 820.20ns 840.161 0.98 1798.13ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 2705.58ns 1963.38 1.38 3608.67ns
sending of values from observable via with_latest_from to subscriber 38.07ns 42.0955 0.90 6.31ns

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@victimsnino victimsnino merged commit 97144f7 into main Nov 2, 2022
@victimsnino victimsnino deleted the timeout branch November 2, 2022 21:01
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.

timeout operator
1 participant