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 "delay" operator #269

Merged
merged 9 commits into from
Sep 12, 2022
Merged

Add "delay" operator #269

merged 9 commits into from
Sep 12, 2022

Conversation

tcw165
Copy link
Contributor

@tcw165 tcw165 commented Sep 9, 2022

For #266

@tcw165 tcw165 changed the title Op/delay Add "delay" operator Sep 9, 2022
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Merging #269 (e8cc6a6) into main (cba61a5) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #269      +/-   ##
==========================================
+ Coverage   98.57%   98.59%   +0.02%     
==========================================
  Files          99      101       +2     
  Lines        1399     1420      +21     
==========================================
+ Hits         1379     1400      +21     
  Misses         20       20              
Impacted Files Coverage Δ
src/rpp/rpp/observables/interface_observable.hpp 100.00% <ø> (ø)
src/rpp/rpp/operators/delay.hpp 100.00% <100.00%> (ø)
src/rpp/rpp/operators/fwd/delay.hpp 100.00% <100.00%> (ø)
src/rpp/rpp/operators/fwd/observe_on.hpp 100.00% <100.00%> (ø)
src/rpp/rpp/operators/observe_on.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 Sep 9, 2022

BENCHMARK RESULTS (AUTOGENERATED)

ci-ubuntu-clang

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.40ns 0.352967 1.14 0.40ns
Dynamic observable construction 28.74ns 33.9389 0.85 25.33ns
Specific observable construction + as_dynamic 28.72ns 24.3258 1.18 26.06ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 109.97ns 117.008 0.94 294.71ns
Specific observable lift dynamic observer 142.01ns 164.089 0.87 310.75ns
Dynamic observable lift specific observer 186.85ns 188.649 0.99 342.57ns
Dynamic observable lift dynamic observer 203.33ns 169.727 1.20 332.20ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 73.85ns 92.6368 0.80 292.71ns
Specific observable subscribe dynamic observer 90.11ns 91.5331 0.98 300.68ns
Dynamic observable subscribe specific observer 140.73ns 132.312 1.06 331.59ns
Dynamic observable subscribe dynamic observer 143.81ns 132.417 1.09 314.46ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 74.46ns 73.546 1.01 303.28ns
Dynamic observable subscribe lambda 137.38ns 157.887 0.87 328.91ns
Specific observable subscribe lambda without subscription 73.98ns 84.8255 0.87 301.09ns
Dynamic observable subscribe lambda without subscription 136.74ns 156.03 0.88 327.61ns
Specific observable subscribe specific subscriber 40.61ns 40.216 1.01 231.53ns
Dynamic observable subscribe specific subscriber 107.63ns 126.146 0.85 273.96ns
Specific observable subscribe dynamic observer 43.01ns 45.1451 0.95 233.95ns
Dynamic observable subscribe dynamic observer 97.96ns 87.7415 1.12 254.27ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.40ns 0.356071 1.13 0.40ns
Dynamic observer construction 31.45ns 26.7829 1.17 19.26ns
Specific observer construction + as_dynamic 29.22ns 24.2726 1.20 18.89ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.44ns 0.654407 0.67 0.44ns
Dynamic observer OnNext 1.61ns 1.65865 0.97 2.01ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 33.09ns 34.9785 0.95 68.22ns
Make copy of subscriber 16.06ns 17.4562 0.92 4.94ns
Transform subsriber to dynamic 44.65ns 51.0508 0.87 23.55ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 33.06ns 39.2402 0.84 47.98ns
composite_subscription add 53.68ns 55.0152 0.98 96.20ns
composite_subscription unsubscribe 44.16ns 49.8651 0.89 22.01ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 260.94ns 313.327 0.83 1859.84ns
sending of values from observable via buffer to subscriber 6.44ns 6.17701 1.04 23.55ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 297.02ns 274.11 1.08 521.17ns
long stateful chain creation + subscribe 433.93ns 468.629 0.93 849.33ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 925.29ns 930.936 0.99 878.52ns
sending of values from observable via combine_latest to subscriber 34.14ns 32.2408 1.06 1.73ns

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 1967.63ns 1597.95 1.23 3675.82ns
concat_with 2332.11ns 2266.52 1.03 4095.70ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 130.01ns 104.213 1.25 248.26ns
sending of values from observable via distinct_until_changed to subscriber 2.41ns 3.15839 0.76 1.21ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 152.61ns 141.472 1.08 630.69ns
sending of values from observable via first to subscriber 0.64ns 0.675742 0.95 0.81ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 83.81ns 82.6378 1.01 663.92ns
error 132.60ns 146.264 0.91 778.17ns
never 44.55ns 54.4975 0.82 240.63ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 96.59ns 102.449 0.94 696.84ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 0.80ns 1.2346 0.65 110.72ns
re-schedule 10 times 8.50ns 13.8164 0.62 142.15ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 86.03ns 95.4845 0.90 668.29ns
just send variadic 109.25ns 115.27 0.95 763.99ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 189.31ns 191.995 0.99 376.51ns
sending of values from observable via last to subscriber 2.04ns 2.52055 0.81 1.55ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 96.10ns 96.1539 1.00 235.30ns
sending of values from observable via map to subscriber 1.21ns 1.08784 1.11 1.68ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 1939.96ns 1947.7 1.00 3692.81ns
merge_with 2288.34ns 1904.44 1.20 3946.57ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 560.01ns 680.883 0.82 2569.21ns
sending of values from observable via observe_on to subscriber 92.86ns 100.824 0.92 199.36ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 29.54ns 28.7329 1.03 9.70ns
on_error 0.61ns 0.576398 1.05 19.01ns
on_completed 0.61ns 0.561424 1.08 0.60ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 196.34ns 157.64 1.25 153.82ns
get_observable 33.71ns 26.7696 1.26 45.47ns
get_subscriber 66.71ns 63.2891 1.05 12.68ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 4164.76ns 3772.53 1.10 3254.83ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 129.17ns 118.696 1.09 293.28ns
sending of values from observable via scan to subscriber 2.01ns 2.1005 0.95 1.78ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 3.20ns 2.24522 1.42 .
mutex lock increment 22.10ns 20.7008 1.07 .
spin-lock increment 10.44ns 7.53644 1.39 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 124.97ns 141.16 0.89 479.53ns
sending of values from observable via skip to subscriber 2.07ns 2.16835 0.96 2.56ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 2340.28ns 2295.27 1.02 3092.56ns
sending of values from observable via switch_on_next to subscriber 605.47ns 519.611 1.17 698.66ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 194.16ns 185.89 1.04 508.20ns
sending of values from observable via take to subscriber 2.58ns 2.83678 0.91 2.46ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 230.95ns 238.422 0.97 558.61ns
sending of values from observable via take_last to subscriber 3.02ns 4.08452 0.74 3.51ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1104.87ns 1008.8 1.10 1314.20ns
sending of values from observable via take_until to subscriber 10.44ns 10.6133 0.98 1.90ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 11.14ns 14.1529 0.79 152.32ns
re-schedule 10 times 27.44ns 27.9024 0.98 184.59ns
recursively schedule 10 times 1371.49ns 1166.79 1.18 5347.42ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 2177.81ns 1939.95 1.12 3251.39ns
sending of values from observable via window to subscriber 581.89ns 614.716 0.95 377.21ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1071.77ns 1118.97 0.96 1109.24ns
sending of values from observable via with_latest_from to subscriber 28.91ns 31.1749 0.93 2.46ns

ci-ubuntu-gcc

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.39ns 0.335078 1.16 0.38ns
Dynamic observable construction 35.44ns 31.5644 1.12 27.01ns
Specific observable construction + as_dynamic 36.27ns 31.5718 1.15 24.38ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 142.81ns 118.854 1.20 396.25ns
Specific observable lift dynamic observer 167.49ns 144.973 1.16 415.07ns
Dynamic observable lift specific observer 173.77ns 198.989 0.87 462.71ns
Dynamic observable lift dynamic observer 241.77ns 208.148 1.16 437.19ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 99.44ns 82.7552 1.20 386.19ns
Specific observable subscribe dynamic observer 109.53ns 95.4868 1.15 396.07ns
Dynamic observable subscribe specific observer 180.41ns 150.007 1.20 436.67ns
Dynamic observable subscribe dynamic observer 176.88ns 146.099 1.21 414.19ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 96.41ns 83.4144 1.16 389.33ns
Dynamic observable subscribe lambda 180.80ns 152.063 1.19 457.62ns
Specific observable subscribe lambda without subscription 100.24ns 83.6128 1.20 389.09ns
Dynamic observable subscribe lambda without subscription 179.36ns 152.401 1.18 442.06ns
Specific observable subscribe specific subscriber 60.30ns 50.2443 1.20 324.68ns
Dynamic observable subscribe specific subscriber 141.00ns 118.049 1.19 380.41ns
Specific observable subscribe dynamic observer 57.31ns 50.0725 1.14 323.40ns
Dynamic observable subscribe dynamic observer 118.25ns 104.666 1.13 346.11ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.41ns 0.335003 1.21 0.40ns
Dynamic observer construction 37.92ns 31.4888 1.20 24.93ns
Specific observer construction + as_dynamic 37.91ns 28.4128 1.33 24.79ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.39ns 0.335299 1.17 0.40ns
Dynamic observer OnNext 2.01ns 2.01267 1.00 2.42ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 39.74ns 34.5821 1.15 69.96ns
Make copy of subscriber 20.10ns 16.7118 1.20 5.53ns
Transform subsriber to dynamic 53.26ns 44.8096 1.19 30.34ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 38.91ns 34.479 1.13 66.84ns
composite_subscription add 56.17ns 46.8414 1.20 115.12ns
composite_subscription unsubscribe 50.49ns 41.8892 1.21 26.58ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 297.49ns 253.96 1.17 2263.56ns
sending of values from observable via buffer to subscriber 7.49ns 6.24996 1.20 35.01ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 339.81ns 301.095 1.13 822.12ns
long stateful chain creation + subscribe 457.45ns 437.123 1.05 1273.49ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1120.41ns 945.104 1.19 1300.42ns
sending of values from observable via combine_latest to subscriber 32.62ns 27.4448 1.19 2.81ns

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 2202.43ns 1927.33 1.14 3981.00ns
concat_with 2645.00ns 2284.33 1.16 4363.61ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 162.46ns 145.448 1.12 421.05ns
sending of values from observable via distinct_until_changed to subscriber 4.56ns 3.34534 1.36 1.53ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 180.75ns 161.595 1.12 775.95ns
sending of values from observable via first to subscriber 0.81ns 0.67065 1.20 1.21ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 98.28ns 87.8282 1.12 881.25ns
error 156.90ns 130.587 1.20 1019.70ns
never 55.39ns 49.2752 1.12 338.03ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 124.35ns 107.634 1.16 891.55ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.91ns 1.67597 1.14 156.63ns
re-schedule 10 times 24.45ns 22.8076 1.07 197.49ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 103.04ns 90.698 1.14 911.26ns
just send variadic 156.62ns 127.091 1.23 962.75ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 227.09ns 196.031 1.16 479.79ns
sending of values from observable via last to subscriber 3.14ns 2.67646 1.17 1.61ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 121.33ns 100.832 1.20 407.57ns
sending of values from observable via map to subscriber 1.01ns 0.837968 1.20 2.82ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 2226.75ns 1884.52 1.18 4359.24ns
merge_with 2554.05ns 2242.02 1.14 4623.00ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 701.42ns 609.757 1.15 3281.91ns
sending of values from observable via observe_on to subscriber 106.73ns 87.5539 1.22 271.94ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 25.46ns 22.7522 1.12 11.79ns
on_error 0.76ns 0.67459 1.12 20.21ns
on_completed 0.75ns 0.676554 1.11 1.21ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 250.76ns 208.852 1.20 203.37ns
get_observable 33.67ns 29.4411 1.14 58.01ns
get_subscriber 65.58ns 57.318 1.14 27.40ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 4809.39ns 4171.41 1.15 3687.90ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 181.79ns 137.127 1.33 459.52ns
sending of values from observable via scan to subscriber 3.61ns 3.66221 0.99 2.01ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.30ns 2.0071 1.15 .
mutex lock increment 21.25ns 18.0785 1.18 .
spin-lock increment 9.62ns 9.0413 1.06 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 154.07ns 136.535 1.13 622.23ns
sending of values from observable via skip to subscriber 3.55ns 3.01095 1.18 2.78ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 2774.06ns 2361.0 1.17 5068.42ns
sending of values from observable via switch_on_next to subscriber 720.08ns 598.607 1.20 1311.74ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 226.72ns 192.087 1.18 669.04ns
sending of values from observable via take to subscriber 4.25ns 3.68262 1.15 4.68ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 266.25ns 230.941 1.15 758.08ns
sending of values from observable via take_last to subscriber 3.79ns 3.06595 1.24 6.97ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1191.66ns 1088.7 1.09 1679.51ns
sending of values from observable via take_until to subscriber 9.66ns 10.4523 0.92 2.15ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 24.07ns 19.9951 1.20 221.10ns
re-schedule 10 times 58.94ns 49.4007 1.19 255.04ns
recursively schedule 10 times 1616.64ns 1434.88 1.13 7868.43ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 2568.50ns 2163.17 1.19 3679.30ns
sending of values from observable via window to subscriber 679.04ns 582.41 1.17 469.48ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1243.61ns 1119.35 1.11 1638.27ns
sending of values from observable via with_latest_from to subscriber 29.14ns 25.4269 1.15 5.05ns

ci-windows

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 2.01ns 1.50388 1.33 0.80ns
Dynamic observable construction 73.06ns 81.6433 0.89 127.83ns
Specific observable construction + as_dynamic 72.57ns 81.4665 0.89 128.72ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 160.11ns 152.879 1.05 1180.67ns
Specific observable lift dynamic observer 188.18ns 202.844 0.93 1230.20ns
Dynamic observable lift specific observer 279.73ns 302.412 0.92 1362.05ns
Dynamic observable lift dynamic observer 259.80ns 261.232 0.99 1272.95ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 122.44ns 138.223 0.89 1155.55ns
Specific observable subscribe dynamic observer 136.98ns 153.435 0.89 1185.67ns
Dynamic observable subscribe specific observer 230.94ns 257.278 0.90 1320.47ns
Dynamic observable subscribe dynamic observer 188.14ns 201.606 0.93 1213.19ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 121.79ns 138.751 0.88 1155.14ns
Dynamic observable subscribe lambda 227.47ns 258.323 0.88 1314.42ns
Specific observable subscribe lambda without subscription 123.35ns 138.011 0.89 1139.91ns
Dynamic observable subscribe lambda without subscription 231.02ns 258.141 0.89 1322.22ns
Specific observable subscribe specific subscriber 45.41ns 49.2909 0.92 845.60ns
Dynamic observable subscribe specific subscriber 151.79ns 166.26 0.91 1011.88ns
Specific observable subscribe dynamic observer 49.34ns 52.5102 0.94 872.41ns
Dynamic observable subscribe dynamic observer 106.91ns 111.96 0.95 910.00ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 2.01ns 1.50283 1.34 2.00ns
Dynamic observer construction 73.34ns 83.66 0.88 107.25ns
Specific observer construction + as_dynamic 73.58ns 88.0362 0.84 107.30ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.80ns 0.668764 1.20 0.47ns
Dynamic observer OnNext 2.01ns 1.78787 1.12 2.01ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 72.60ns 85.301 0.85 327.67ns
Make copy of subscriber 16.06ns 16.716 0.96 36.94ns
Transform subsriber to dynamic 87.16ns 97.6437 0.89 144.78ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 73.62ns 85.1338 0.86 321.27ns
composite_subscription add 66.39ns 71.8063 0.92 166.91ns
composite_subscription unsubscribe 61.12ns 62.6327 0.98 116.41ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 362.65ns 388.183 0.93 4335.33ns
sending of values from observable via buffer to subscriber 7.55ns 6.45212 1.17 84.33ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 311.50ns 284.397 1.10 1718.07ns
long stateful chain creation + subscribe 667.58ns 682.2 0.98 3262.12ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1565.73ns 1675.67 0.93 3019.43ns
sending of values from observable via combine_latest to subscriber 46.57ns 44.5577 1.05 3.81ns

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 2690.10ns 2775.3 0.97 10579.70ns
concat_with 3407.88ns 3474.62 0.98 11731.30ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 193.72ns 202.323 0.96 1028.58ns
sending of values from observable via distinct_until_changed to subscriber 3.67ns 3.67804 1.00 3.22ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 155.80ns 161.382 0.97 2644.70ns
sending of values from observable via first to subscriber 2.52ns 2.34339 1.07 1.22ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 83.48ns 83.3004 1.00 2364.91ns
error 143.36ns 139.57 1.03 2526.60ns
never 47.00ns 50.9068 0.92 881.59ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 138.72ns 144.555 0.96 2436.30ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.61ns 1.54853 1.04 422.68ns
re-schedule 10 times 130.23ns 97.7683 1.33 449.55ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 86.06ns 89.6 0.96 2378.36ns
just send variadic 123.16ns 130.525 0.94 2466.40ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 234.96ns 244.82 0.96 1446.18ns
sending of values from observable via last to subscriber 3.14ns 2.83329 1.11 3.31ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 112.56ns 106.776 1.05 998.28ns
sending of values from observable via map to subscriber 3.60ns 3.65789 0.98 7.41ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 2629.80ns 2679.7 0.98 11040.70ns
merge_with 3350.25ns 3459.62 0.97 11759.00ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 774.93ns 829.567 0.93 5543.80ns
sending of values from observable via observe_on to subscriber 84.18ns 85.8696 0.98 777.66ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 22.64ns 20.2329 1.12 28.32ns
on_error 2.46ns 3.0434 0.81 22.18ns
on_completed 2.94ns 3.03835 0.97 0.81ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 331.85ns 362.892 0.91 608.88ns
get_observable 31.04ns 28.7196 1.08 166.80ns
get_subscriber 61.98ns 50.1611 1.24 100.32ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 5871.40ns 7005.2 0.84 11170.00ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 188.78ns 204.593 0.92 1261.60ns
sending of values from observable via scan to subscriber 5.70ns 5.71204 1.00 8.36ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.88ns 1.87994 1.53 .
mutex lock increment 23.84ns 22.7198 1.05 .
spin-lock increment 10.42ns 9.5957 1.09 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 186.44ns 195.908 0.95 1574.13ns
sending of values from observable via skip to subscriber 3.61ns 4.75986 0.76 3.33ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 3401.62ns 3544.88 0.96 11995.00ns
sending of values from observable via switch_on_next to subscriber 838.03ns 856.067 0.98 3075.56ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 241.12ns 248.89 0.97 2158.67ns
sending of values from observable via take to subscriber 5.49ns 5.67076 0.97 5.70ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 333.64ns 353.909 0.94 2403.91ns
sending of values from observable via take_last to subscriber 4.47ns 4.38855 1.02 20.14ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1548.25ns 1614.62 0.96 5145.80ns
sending of values from observable via take_until to subscriber 12.63ns 11.1256 1.13 4.93ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 18.22ns 18.8001 0.97 603.46ns
re-schedule 10 times 143.61ns 120.887 1.19 639.80ns
recursively schedule 10 times 2412.73ns 3153.8 0.77 19492.50ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 3036.56ns 2976.78 1.02 9527.33ns
sending of values from observable via window to subscriber 819.97ns 737.086 1.11 1586.12ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1915.25ns 2023.17 0.95 3803.33ns
sending of values from observable via with_latest_from to subscriber 35.74ns 37.7593 0.95 6.54ns

@tcw165 tcw165 marked this pull request as ready for review September 9, 2022 23:39
Copy link
Owner

@victimsnino victimsnino left a comment

Choose a reason for hiding this comment

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

Good!

src/rpp/rpp/operators/fwd/delay.hpp Outdated Show resolved Hide resolved
src/rpp/rpp/operators/fwd/delay.hpp Show resolved Hide resolved
src/rpp/rpp/operators/delay.hpp Outdated Show resolved Hide resolved
src/tests/test_delay.cpp Outdated Show resolved Hide resolved
@victimsnino
Copy link
Owner

What do you think about re-using delay inside observe_on?? We can think that observe_on == delay(0)

@sonarqubecloud
Copy link

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 85fdc9e into victimsnino:main Sep 12, 2022
@tcw165 tcw165 deleted the op/delay branch September 13, 2022 06:34
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.

2 participants