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

Use queue based scheduling in Delay #305

Merged
merged 7 commits into from
Dec 8, 2022
Merged

Conversation

victimsnino
Copy link
Owner

@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Merging #305 (434e148) into main (8c6431e) will decrease coverage by 0.14%.
The diff coverage is 94.23%.

@@            Coverage Diff             @@
##             main     #305      +/-   ##
==========================================
- Coverage   98.24%   98.09%   -0.15%     
==========================================
  Files         110      110              
  Lines        1596     1631      +35     
==========================================
+ Hits         1568     1600      +32     
- Misses         28       31       +3     
Impacted Files Coverage Δ
src/rpp/rpp/operators/delay.hpp 94.73% <94.23%> (-5.27%) ⬇️

📣 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 Dec 8, 2022

BENCHMARK RESULTS (AUTOGENERATED)

ci-macos

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.34ns 0.274855 1.22 0.34ns
Dynamic observable construction 85.43ns 68.0325 1.26 749.98ns
Specific observable construction + as_dynamic 84.41ns 67.1998 1.26 130.22ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 155.00ns 130.178 1.19 1330.42ns
Specific observable lift dynamic observer 191.71ns 155.29 1.23 1434.79ns
Dynamic observable lift specific observer 315.53ns 252.077 1.25 1501.59ns
Dynamic observable lift dynamic observer 252.88ns 201.807 1.25 1458.35ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 1136.13ns 108.225 10.50 1320.80ns
Specific observable subscribe dynamic observer 170.41ns 119.933 1.42 1591.60ns
Dynamic observable subscribe specific observer 275.26ns 197.396 1.39 3802.22ns
Dynamic observable subscribe dynamic observer 188.16ns 157.176 1.20 1394.42ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 128.12ns 124.359 1.03 1296.46ns
Dynamic observable subscribe lambda 277.76ns 216.556 1.28 1451.72ns
Specific observable subscribe lambda without subscription 576.79ns 106.7 5.41 1519.44ns
Dynamic observable subscribe lambda without subscription 260.88ns 208.934 1.25 1471.06ns
Specific observable subscribe specific subscriber 213.84ns 30.16 7.09 958.14ns
Dynamic observable subscribe specific subscriber 184.86ns 129.692 1.43 2439.57ns
Specific observable subscribe dynamic observer 71.92ns 44.9972 1.60 985.99ns
Dynamic observable subscribe dynamic observer 85.25ns 71.8286 1.19 1038.67ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.31ns 0.278257 1.12 0.34ns
Dynamic observer construction 83.02ns 80.8627 1.03 125.01ns
Specific observer construction + as_dynamic 85.38ns 68.2969 1.25 129.24ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.91ns 0.780097 1.16 0.95ns
Dynamic observer OnNext 2.38ns 2.14451 1.11 2.61ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 90.96ns 74.9968 1.21 362.93ns
Make copy of subscriber 14.14ns 12.2488 1.15 30.45ns
Transform subsriber to dynamic 418.77ns 82.7033 5.06 155.62ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 89.49ns 77.0166 1.16 808.08ns
composite_subscription add 68.55ns 55.4581 1.24 139.78ns
composite_subscription unsubscribe 107.54ns 72.4754 1.48 105.13ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 436.54ns 327.996 1.33 3826.39ns
sending of values from observable via buffer to subscriber 7.29ns 5.82724 1.25 187.15ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 266.68ns 216.072 1.23 1761.72ns
long stateful chain creation + subscribe 654.72ns 544.938 1.20 3203.76ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1739.33ns 1280.98 1.36 .
sending of values from observable via combine_latest to subscriber 33.70ns 30.7893 1.09 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 3157.34ns 3863.31 0.82 11114.90ns
concat_with 3883.55ns 3123.05 1.24 12424.00ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 220.81ns 144.91 1.52 1482.55ns
sending of values from observable via distinct_until_changed to subscriber 2.76ns 2.23441 1.24 1.37ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 140.05ns 121.082 1.16 2620.21ns
sending of values from observable via first to subscriber 1.04ns 0.839322 1.24 1.05ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 236.46ns 61.3358 3.86 2606.23ns
error 188.19ns 108.053 1.74 2753.55ns
never 55.42ns 31.9034 1.74 999.09ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 165.85ns 147.811 1.12 2667.65ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 2.34ns 1.97636 1.18 463.31ns
re-schedule 10 times 31.43ns 25.6821 1.22 513.57ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 92.40ns 64.0241 1.44 2610.89ns
just send variadic 112.35ns 94.1132 1.19 3918.18ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 265.05ns 214.964 1.23 1526.85ns
sending of values from observable via last to subscriber 3.10ns 2.58012 1.20 2.01ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 87.18ns 65.796 1.33 1031.44ns
sending of values from observable via map to subscriber 2.08ns 1.11946 1.85 1.68ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 3060.12ns 2756.75 1.11 13722.00ns
merge_with 3891.37ns 3130.63 1.24 21018.90ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 2281.86ns 624.539 3.65 10930.20ns
sending of values from observable via observe_on to subscriber 343.24ns 97.0436 3.54 932.30ns

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 1281.33ns 581.039 2.21 3633.21ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 24.75ns 20.66 1.20 37.24ns
on_error 0.67ns 0.576152 1.17 21.83ns
on_completed 0.67ns 0.564353 1.20 2.81ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 409.38ns 350.899 1.17 658.38ns
get_observable 31.37ns 26.6878 1.18 183.75ns
get_subscriber 64.96ns 52.2397 1.24 95.02ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 8747.35ns 5233.06 1.67 11273.60ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 203.19ns 153.822 1.32 1543.91ns
sending of values from observable via scan to subscriber 4.97ns 3.14749 1.58 2.35ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.23ns 1.85752 1.20 .
mutex lock increment 27.75ns 22.9602 1.21 .
spin-lock increment 10.82ns 8.27953 1.31 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 187.74ns 143.208 1.31 1637.84ns
sending of values from observable via skip to subscriber 2.78ns 2.23639 1.24 2.30ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 4035.50ns 3095.33 1.30 11600.90ns
sending of values from observable via switch_on_next to subscriber 988.15ns 754.827 1.31 3088.25ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 237.17ns 192.435 1.23 2130.15ns
sending of values from observable via take to subscriber 3.45ns 2.73928 1.26 6.59ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 367.82ns 293.853 1.25 2490.85ns
sending of values from observable via take_last to subscriber 4.61ns 2.72033 1.70 6.17ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1830.23ns 1497.86 1.22 5410.48ns
sending of values from observable via take_until to subscriber 10.38ns 7.78601 1.33 2.84ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 33726.20ns 6584.3 5.12 5087.40ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 84.11ns 68.3124 1.23 1042.21ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 37.75ns 42.9115 0.88 729.51ns
re-schedule 10 times 107.93ns 114.342 0.94 792.88ns
recursively schedule 10 times 2595.00ns 1930.72 1.34 18840.60ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 3699.15ns 2907.95 1.27 9805.70ns
sending of values from observable via window to subscriber 1001.20ns 810.912 1.23 1695.82ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 3292.82ns 1544.0 2.13 .
sending of values from observable via with_latest_from to subscriber 33.43ns 27.3336 1.22 .

ci-ubuntu-clang

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.33ns 0.335352 1.00 0.34ns
Dynamic observable construction 18.16ns 29.2391 0.62 30.49ns
Specific observable construction + as_dynamic 18.01ns 29.1716 0.62 30.31ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 50.35ns 88.841 0.57 323.16ns
Specific observable lift dynamic observer 51.01ns 110.92 0.46 346.77ns
Dynamic observable lift specific observer 84.35ns 170.888 0.49 385.58ns
Dynamic observable lift dynamic observer 75.13ns 173.642 0.43 364.24ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 36.63ns 57.9115 0.63 317.90ns
Specific observable subscribe dynamic observer 37.35ns 71.6062 0.52 352.85ns
Dynamic observable subscribe specific observer 70.42ns 126.778 0.56 362.21ns
Dynamic observable subscribe dynamic observer 59.92ns 120.628 0.50 349.04ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 36.67ns 58.1797 0.63 320.11ns
Dynamic observable subscribe lambda 68.67ns 124.331 0.55 361.82ns
Specific observable subscribe lambda without subscription 36.72ns 58.0124 0.63 320.31ns
Dynamic observable subscribe lambda without subscription 65.00ns 124.313 0.52 362.46ns
Specific observable subscribe specific subscriber 13.74ns 27.8418 0.49 259.29ns
Dynamic observable subscribe specific subscriber 42.81ns 88.2941 0.48 300.88ns
Specific observable subscribe dynamic observer 13.78ns 27.8343 0.50 287.50ns
Dynamic observable subscribe dynamic observer 33.53ns 75.304 0.45 286.84ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.34ns 0.334641 1.00 0.34ns
Dynamic observer construction 18.07ns 29.1461 0.62 23.78ns
Specific observer construction + as_dynamic 17.40ns 29.1884 0.60 23.83ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.670161 1.00 0.67ns
Dynamic observer OnNext 1.68ns 2.00973 0.83 2.34ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 20.01ns 35.0367 0.57 68.02ns
Make copy of subscriber 6.97ns 16.7556 0.42 8.14ns
Transform subsriber to dynamic 20.00ns 45.8624 0.44 27.97ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 19.44ns 34.8753 0.56 60.62ns
composite_subscription add 18.24ns 49.1276 0.37 87.20ns
composite_subscription unsubscribe 30.38ns 44.0597 0.69 29.90ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 151.89ns 244.77 0.62 1861.76ns
sending of values from observable via buffer to subscriber 6.70ns 5.02802 1.33 25.77ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 102.41ns 260.451 0.39 586.59ns
long stateful chain creation + subscribe 144.71ns 378.575 0.38 1597.74ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 460.42ns 856.689 0.54 .
sending of values from observable via combine_latest to subscriber 13.84ns 27.47 0.50 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 1053.91ns 1854.15 0.57 3540.11ns
concat_with 1194.14ns 2162.74 0.55 3849.49ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 51.63ns 112.639 0.46 299.36ns
sending of values from observable via distinct_until_changed to subscriber 2.01ns 2.67886 0.75 1.17ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 62.41ns 122.81 0.51 703.12ns
sending of values from observable via first to subscriber 1.01ns 0.672395 1.50 1.01ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 36.35ns 63.5267 0.57 680.04ns
error 81.36ns 114.132 0.71 773.12ns
never 14.56ns 28.6812 0.51 271.77ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 48.10ns 80.2138 0.60 710.81ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.34ns 0.670637 2.00 122.77ns
re-schedule 10 times 7.72ns 9.3912 0.82 153.77ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 38.43ns 64.8324 0.59 697.65ns
just send variadic 69.86ns 95.5077 0.73 758.60ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 88.50ns 168.185 0.53 423.62ns
sending of values from observable via last to subscriber 2.03ns 2.0855 0.97 1.34ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 30.46ns 68.83 0.44 285.51ns
sending of values from observable via map to subscriber 1.34ns 1.00537 1.33 2.01ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 1002.96ns 1807.02 0.56 3513.56ns
merge_with 1140.17ns 2109.81 0.54 3859.37ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 554.55ns 429.678 1.29 2840.82ns
sending of values from observable via observe_on to subscriber 125.65ns 60.6661 2.07 241.12ns

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 233.82ns 419.889 0.56 819.97ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 19.10ns 24.0949 0.79 14.91ns
on_error 0.67ns 0.505683 1.33 16.84ns
on_completed 0.68ns 0.504884 1.34 0.67ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 123.41ns 198.52 0.62 181.31ns
get_observable 7.91ns 29.1215 0.27 50.90ns
get_subscriber 19.66ns 60.4856 0.32 19.80ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 2183.97ns 3935.43 0.55 3252.20ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 46.17ns 99.4447 0.46 377.64ns
sending of values from observable via scan to subscriber 2.01ns 1.67475 1.20 2.34ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.01ns 2.01827 1.00 .
mutex lock increment 8.02ns 18.0791 0.44 .
spin-lock increment 9.05ns 9.04377 1.00 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 45.64ns 99.1696 0.46 533.33ns
sending of values from observable via skip to subscriber 2.01ns 1.67324 1.20 1.79ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 1214.57ns 2205.89 0.55 3559.98ns
sending of values from observable via switch_on_next to subscriber 300.20ns 569.14 0.53 800.52ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 81.92ns 167.671 0.49 580.58ns
sending of values from observable via take to subscriber 2.35ns 2.34683 1.00 2.69ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 115.08ns 210.805 0.55 623.61ns
sending of values from observable via take_last to subscriber 2.39ns 3.14195 0.76 4.09ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 585.66ns 1028.22 0.57 1387.76ns
sending of values from observable via take_until to subscriber 8.69ns 10.179 0.85 2.37ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 798.50ns 1066.77 0.75 26046.90ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 41.47ns 55.7746 0.74 20424.40ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 8.73ns 12.4097 0.70 181.33ns
re-schedule 10 times 28.19ns 31.849 0.89 216.35ns
recursively schedule 10 times 1472.67ns 1416.79 1.04 9014.25ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 1011.34ns 1956.59 0.52 3324.71ns
sending of values from observable via window to subscriber 264.03ns 531.235 0.50 425.51ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 529.97ns 1020.55 0.52 .
sending of values from observable via with_latest_from to subscriber 14.72ns 26.8054 0.55 .

ci-ubuntu-gcc

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.40ns 0.334886 1.20 0.40ns
Dynamic observable construction 28.90ns 31.5533 0.92 53.31ns
Specific observable construction + as_dynamic 30.85ns 31.5965 0.98 52.58ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 96.30ns 97.8632 0.98 769.71ns
Specific observable lift dynamic observer 130.23ns 126.628 1.03 819.97ns
Dynamic observable lift specific observer 191.92ns 182.056 1.05 877.82ns
Dynamic observable lift dynamic observer 209.04ns 194.073 1.08 848.37ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 60.76ns 60.9903 1.00 736.02ns
Specific observable subscribe dynamic observer 76.34ns 79.1095 0.96 759.00ns
Dynamic observable subscribe specific observer 130.74ns 129.866 1.01 827.11ns
Dynamic observable subscribe dynamic observer 133.66ns 127.655 1.05 773.51ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 60.20ns 60.9108 0.99 751.49ns
Dynamic observable subscribe lambda 130.67ns 130.83 1.00 823.69ns
Specific observable subscribe lambda without subscription 60.00ns 60.721 0.99 735.92ns
Dynamic observable subscribe lambda without subscription 132.21ns 130.677 1.01 829.36ns
Specific observable subscribe specific subscriber 27.45ns 30.4639 0.90 640.40ns
Dynamic observable subscribe specific subscriber 97.13ns 97.132 1.00 729.55ns
Specific observable subscribe dynamic observer 26.96ns 30.422 0.89 655.00ns
Dynamic observable subscribe dynamic observer 90.78ns 85.1122 1.07 666.77ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.40ns 0.334983 1.20 0.40ns
Dynamic observer construction 30.79ns 31.5013 0.98 45.21ns
Specific observer construction + as_dynamic 30.32ns 31.4823 0.96 48.14ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.43ns 0.335607 1.29 0.41ns
Dynamic observer OnNext 1.61ns 1.68423 0.95 1.61ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 33.94ns 34.5334 0.98 132.40ns
Make copy of subscriber 16.08ns 16.7172 0.96 30.98ns
Transform subsriber to dynamic 45.69ns 44.4914 1.03 76.74ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 33.98ns 34.4905 0.99 124.54ns
composite_subscription add 51.50ns 49.4293 1.04 123.63ns
composite_subscription unsubscribe 44.92ns 41.6476 1.08 38.95ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 229.80ns 235.565 0.98 2956.62ns
sending of values from observable via buffer to subscriber 6.19ns 6.37764 0.97 29.11ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 324.02ns 288.566 1.12 1444.39ns
long stateful chain creation + subscribe 456.54ns 424.861 1.07 4120.05ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 844.90ns 905.766 0.93 .
sending of values from observable via combine_latest to subscriber 13.54ns 28.4563 0.48 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 1968.92ns 1911.83 1.03 7883.19ns
concat_with 2343.91ns 2252.16 1.04 8515.44ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 119.76ns 120.21 1.00 759.82ns
sending of values from observable via distinct_until_changed to subscriber 3.24ns 2.7135 1.19 2.01ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 146.23ns 137.913 1.06 1773.16ns
sending of values from observable via first to subscriber 1.21ns 1.00615 1.20 0.81ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 67.40ns 68.6075 0.98 1824.69ns
error 115.94ns 116.749 0.99 1856.99ns
never 28.98ns 32.3713 0.90 659.68ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 82.61ns 86.785 0.95 1841.63ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 0.81ns 1.34133 0.61 296.41ns
re-schedule 10 times 19.06ns 22.4448 0.85 335.47ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 70.09ns 70.3977 1.00 1865.36ns
just send variadic 94.07ns 111.686 0.84 1876.55ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 181.01ns 176.097 1.03 1082.67ns
sending of values from observable via last to subscriber 1.90ns 2.07588 0.91 1.41ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 82.59ns 82.0255 1.01 781.57ns
sending of values from observable via map to subscriber 1.07ns 0.753616 1.42 1.61ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 1922.36ns 1864.7 1.03 9733.68ns
merge_with 2326.37ns 2202.02 1.06 9488.68ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 817.52ns 465.677 1.76 3477.75ns
sending of values from observable via observe_on to subscriber 161.19ns 63.9244 2.52 528.37ns

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 460.18ns 434.675 1.06 1523.13ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 29.74ns 22.4207 1.33 13.72ns
on_error 1.21ns 0.673534 1.80 16.21ns
on_completed 1.21ns 1.3478 0.90 0.81ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 213.23ns 208.77 1.02 383.16ns
get_observable 33.28ns 29.4414 1.13 100.11ns
get_subscriber 63.75ns 57.3858 1.11 98.46ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 4373.11ns 4090.41 1.07 7406.15ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 115.19ns 115.795 0.99 952.99ns
sending of values from observable via scan to subscriber 2.01ns 2.01614 1.00 1.61ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.22ns 2.0098 1.10 .
mutex lock increment 6.84ns 18.0487 0.38 .
spin-lock increment 10.44ns 9.03592 1.16 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 112.76ns 114.662 0.98 1149.45ns
sending of values from observable via skip to subscriber 2.56ns 2.34603 1.09 2.73ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 2452.82ns 2309.01 1.06 11314.60ns
sending of values from observable via switch_on_next to subscriber 628.25ns 604.265 1.04 3177.48ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 171.79ns 173.575 0.99 1422.09ns
sending of values from observable via take to subscriber 4.08ns 3.50733 1.16 3.06ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 215.68ns 207.372 1.04 1444.66ns
sending of values from observable via take_last to subscriber 3.37ns 3.10521 1.09 6.42ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1113.55ns 1075.54 1.04 3753.20ns
sending of values from observable via take_until to subscriber 10.45ns 9.03929 1.16 2.03ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1114.51ns 1139.45 0.98 12084.30ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 63.15ns 60.4933 1.04 2453.35ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 19.93ns 22.468 0.89 379.36ns
re-schedule 10 times 43.60ns 50.3947 0.87 416.70ns
recursively schedule 10 times 1415.80ns 1598.49 0.89 20198.40ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 2076.92ns 2094.15 0.99 6185.75ns
sending of values from observable via window to subscriber 568.28ns 573.216 0.99 981.77ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1050.57ns 1072.37 0.98 .
sending of values from observable via with_latest_from to subscriber 13.69ns 26.7347 0.51 .

ci-windows

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 1.66ns 1.50288 1.10 0.63ns
Dynamic observable construction 71.79ns 79.4874 0.90 113.98ns
Specific observable construction + as_dynamic 89.17ns 79.5925 1.12 114.21ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 158.13ns 145.085 1.09 1096.32ns
Specific observable lift dynamic observer 174.04ns 180.423 0.96 1126.60ns
Dynamic observable lift specific observer 248.38ns 287.191 0.86 1235.65ns
Dynamic observable lift dynamic observer 249.90ns 237.804 1.05 1318.89ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 114.79ns 112.867 1.02 1366.05ns
Specific observable subscribe dynamic observer 154.70ns 132.653 1.17 1302.67ns
Dynamic observable subscribe specific observer 206.62ns 228.622 0.90 1332.19ns
Dynamic observable subscribe dynamic observer 175.87ns 181.739 0.97 1088.85ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 127.68ns 113.928 1.12 1304.00ns
Dynamic observable subscribe lambda 223.69ns 228.009 0.98 1263.18ns
Specific observable subscribe lambda without subscription 275.70ns 113.587 2.43 1033.40ns
Dynamic observable subscribe lambda without subscription 275.45ns 229.514 1.20 1297.83ns
Specific observable subscribe specific subscriber 31.79ns 30.8265 1.03 1068.76ns
Dynamic observable subscribe specific subscriber 144.49ns 147.919 0.98 1065.14ns
Specific observable subscribe dynamic observer 37.67ns 30.7925 1.22 826.74ns
Dynamic observable subscribe dynamic observer 85.86ns 79.047 1.09 961.20ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 1.81ns 1.50434 1.21 1.67ns
Dynamic observer construction 100.87ns 81.1757 1.24 101.78ns
Specific observer construction + as_dynamic 94.16ns 81.4531 1.16 117.19ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.63ns 0.670659 0.94 0.64ns
Dynamic observer OnNext 1.80ns 1.67338 1.07 2.02ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 77.60ns 87.6847 0.88 353.76ns
Make copy of subscriber 14.87ns 17.1355 0.87 27.56ns
Transform subsriber to dynamic 81.63ns 95.7623 0.85 130.70ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 103.98ns 86.0 1.21 310.54ns
composite_subscription add 75.63ns 70.9579 1.07 168.96ns
composite_subscription unsubscribe 72.37ns 63.0903 1.15 154.03ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 396.04ns 352.803 1.12 4253.17ns
sending of values from observable via buffer to subscriber 6.25ns 7.04999 0.89 84.58ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 239.97ns 268.679 0.89 1829.62ns
long stateful chain creation + subscribe 647.61ns 659.486 0.98 3152.14ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1912.38ns 1650.38 1.16 .
sending of values from observable via combine_latest to subscriber 49.44ns 47.081 1.05 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 2692.12ns 2735.0 0.98 10798.00ns
concat_with 2989.86ns 3407.88 0.88 11668.50ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 198.34ns 183.522 1.08 1100.57ns
sending of values from observable via distinct_until_changed to subscriber 4.44ns 4.67281 0.95 3.88ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 122.56ns 127.84 0.96 2796.00ns
sending of values from observable via first to subscriber 2.39ns 2.34651 1.02 0.85ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 93.48ns 64.1038 1.46 2382.20ns
error 111.72ns 113.489 0.98 2363.44ns
never 32.27ns 30.7749 1.05 856.83ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 166.40ns 134.842 1.23 2405.33ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.39ns 2.13538 0.65 391.88ns
re-schedule 10 times 103.08ns 97.7308 1.05 451.27ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 68.71ns 68.0833 1.01 2498.44ns
just send variadic 93.03ns 103.327 0.90 2531.40ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 216.51ns 222.48 0.97 1280.53ns
sending of values from observable via last to subscriber 3.02ns 3.19402 0.95 3.89ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 75.09ns 87.8893 0.85 1184.12ns
sending of values from observable via map to subscriber 3.91ns 4.01452 0.98 7.87ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 3823.00ns 2656.2 1.44 12342.30ns
merge_with 3061.71ns 3333.88 0.92 10828.30ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 1213.39ns 617.95 1.96 6299.25ns
sending of values from observable via observe_on to subscriber 184.08ns 63.6809 2.89 888.38ns

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 679.21ns 640.897 1.06 2017.00ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 18.70ns 19.7214 0.95 29.24ns
on_error 3.13ns 3.06583 1.02 18.93ns
on_completed 2.92ns 3.0316 0.96 0.59ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 349.92ns 350.508 1.00 652.52ns
get_observable 22.56ns 28.4141 0.79 173.54ns
get_subscriber 46.83ns 50.2119 0.93 91.40ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 6642.50ns 6009.4 1.11 10697.00ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 252.12ns 185.5 1.36 1165.29ns
sending of values from observable via scan to subscriber 5.47ns 6.35395 0.86 7.82ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.34ns 1.88824 1.24 .
mutex lock increment 21.06ns 25.7256 0.82 .
spin-lock increment 9.51ns 9.03105 1.05 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 170.17ns 176.694 0.96 1493.15ns
sending of values from observable via skip to subscriber 3.70ns 4.35155 0.85 3.95ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 4387.67ns 3511.88 1.25 11235.50ns
sending of values from observable via switch_on_next to subscriber 887.74ns 855.767 1.04 3259.88ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 205.68ns 230.22 0.89 2225.70ns
sending of values from observable via take to subscriber 6.56ns 5.49467 1.19 5.53ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 300.77ns 323.028 0.93 2446.22ns
sending of values from observable via take_last to subscriber 4.54ns 4.40956 1.03 20.57ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1591.93ns 1577.56 1.01 5677.80ns
sending of values from observable via take_until to subscriber 10.25ns 11.4123 0.90 5.89ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1614.00ns 1671.23 0.97 7520.50ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 50.16ns 55.141 0.91 1327.86ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 17.88ns 19.8959 0.90 612.64ns
re-schedule 10 times 121.96ns 122.3 1.00 658.57ns
recursively schedule 10 times 3710.11ns 2612.0 1.42 20763.00ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 2747.88ns 2891.11 0.95 11565.70ns
sending of values from observable via window to subscriber 1010.14ns 824.71 1.22 1613.93ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 2014.82ns 1972.0 1.02 .
sending of values from observable via with_latest_from to subscriber 39.47ns 38.1143 1.04 .

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-tidy found issue(s) with the introduced code (1/1)

template<typename TT>
emission(size_t id, schedulers::time_point time, TT&& item)
: id{id}
, time{std::move(time)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-move-const-arg ⚠️
std::move of the variable time of the trivially-copyable type schedulers::time_point (aka time_point<std::chrono::steady_clock, duration<long, ratio<1, 1000000000>>>) has no effect; remove std::move()

Suggested change
, time{std::move(time)}
, time{time)}

template<typename TT>
emission(size_t id, schedulers::time_point time, TT&& item)
: id{id}
, time{std::move(time)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-move-const-arg ⚠️
std::move of the variable time of the trivially-copyable type schedulers::time_point (aka time_point<std::chrono::steady_clock, duration<long, ratio<1, 1000000000>>>) has no effect; remove std::move()

Suggested change
, time{std::move(time)}
, time{std::move(time}

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 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 4 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@victimsnino victimsnino merged commit 65decf7 into main Dec 8, 2022
@victimsnino victimsnino deleted the delay_queue_based_scheduling branch December 8, 2022 20:33
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