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

Make lift more readable #315

Merged
merged 4 commits into from
Dec 16, 2022
Merged

Make lift more readable #315

merged 4 commits into from
Dec 16, 2022

Conversation

victimsnino
Copy link
Owner

Before:

specific_observable<int, 
rpp::details::lift_on_subscribe<int, 

rpp::details::lift_action_by_callbacks<int, rpp::details::map_impl<int, int (*)(int) noexcept>, rpp::utils::forwarding_on_error, rpp::utils::forwarding_on_completed>,
  
rpp::specific_observable<int, 
rpp::details::lift_on_subscribe<int, 

rpp::details::lift_action_by_callbacks<int, rpp::details::filter_impl<int, std::_Not_fn<int (*)(int) noexcept>>, rpp::utils::forwarding_on_error, rpp::utils::forwarding_on_completed>, 

rpp::specific_observable<int, 
rpp::details::lift_on_subscribe<int, 

rpp::details::lift_action_by_callbacks<int, rpp::details::take_while_impl<int, (lambda)>, rpp::utils::forwarding_on_error, rpp::utils::forwarding_on_completed>, 

rpp::specific_observable<int, 
rpp::details::repeat_on_subscribe<int, 

rpp::specific_observable<int, 
rpp::details::lift_on_subscribe<int, 

rpp::details::lift_action_by_callbacks<int (*)(), rpp::details::map_impl<int (*)(), (lambda)>, rpp::utils::forwarding_on_error, rpp::utils::forwarding_on_completed>, 

rpp::specific_observable<int (*)(), rpp::observable::details::iterate_impl<std::array<int (*)(), 1>, rpp::schedulers::trampoline>>>>, (lambda)>>>>>>>>

After:

specific_observable<int, 
rpp::details::lift_on_subscribe<int, 

rpp::details::map_impl<int, int (*)(int) noexcept>, 

rpp::details::filter_impl<int, std::_Not_fn<int (*)(int) noexcept>>,

rpp::details::take_while_impl<int, (lambda)>, 

rpp::details::repeat_on_subscribe<int, 

rpp::specific_observable<int, 
rpp::details::lift_on_subscribe<int, 

rpp::details::map_impl<int (*)(), (lambda)>, 

rpp::observable::details::iterate_impl<std::array<int (*)(), 1>, rpp::schedulers::trampoline>>>, (lambda)>>>

@victimsnino victimsnino marked this pull request as ready for review December 16, 2022 20:26
@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

Merging #315 (81cb505) into main (f972644) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #315      +/-   ##
==========================================
+ Coverage   97.81%   97.83%   +0.02%     
==========================================
  Files         112      112              
  Lines        1694     1712      +18     
==========================================
+ Hits         1657     1675      +18     
  Misses         37       37              
Impacted Files Coverage Δ
src/rpp/rpp/operators/filter.hpp 100.00% <100.00%> (ø)
src/rpp/rpp/operators/lift.hpp 100.00% <100.00%> (ø)
src/rpp/rpp/operators/map.hpp 100.00% <100.00%> (ø)
src/rpp/rpp/operators/take_while.hpp 100.00% <100.00%> (ø)
src/rpp/rpp/operators/fwd/lift.hpp 100.00% <0.00%> (ø)

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

@github-actions
Copy link
Contributor

BENCHMARK RESULTS (AUTOGENERATED)

ci-macos

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.28ns 0.279083 1.00 0.33ns
Dynamic observable construction 74.21ns 73.8976 1.00 107.80ns
Specific observable construction + as_dynamic 76.35ns 68.5415 1.11 109.92ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 131.56ns 147.438 0.89 1115.23ns
Specific observable lift dynamic observer 152.10ns 151.493 1.00 1119.70ns
Dynamic observable lift specific observer 269.99ns 253.516 1.06 1265.81ns
Dynamic observable lift dynamic observer 211.94ns 219.256 0.97 1205.69ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 110.06ns 122.382 0.90 1077.85ns
Specific observable subscribe dynamic observer 129.55ns 122.163 1.06 1135.75ns
Dynamic observable subscribe specific observer 205.59ns 212.326 0.97 1232.87ns
Dynamic observable subscribe dynamic observer 157.54ns 166.414 0.95 1154.09ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 101.61ns 101.03 1.01 1115.57ns
Dynamic observable subscribe lambda 223.71ns 197.685 1.13 1226.07ns
Specific observable subscribe lambda without subscription 123.40ns 133.158 0.93 1092.70ns
Dynamic observable subscribe lambda without subscription 247.50ns 242.397 1.02 1214.73ns
Specific observable subscribe specific subscriber 29.95ns 29.9074 1.00 822.22ns
Dynamic observable subscribe specific subscriber 141.78ns 130.49 1.09 953.12ns
Specific observable subscribe dynamic observer 31.95ns 31.5167 1.01 836.71ns
Dynamic observable subscribe dynamic observer 73.46ns 71.5468 1.03 848.10ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.36ns 0.281959 1.28 0.38ns
Dynamic observer construction 76.61ns 73.2146 1.05 102.82ns
Specific observer construction + as_dynamic 75.80ns 70.661 1.07 120.45ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.82ns 0.777222 1.06 0.83ns
Dynamic observer OnNext 2.14ns 2.16623 0.99 2.19ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 68.90ns 70.7069 0.97 297.74ns
Make copy of subscriber 12.49ns 12.3975 1.01 26.79ns
Transform subsriber to dynamic 91.28ns 84.7175 1.08 128.13ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 78.48ns 72.7037 1.08 291.04ns
composite_subscription add 56.07ns 81.4857 0.69 104.70ns
composite_subscription unsubscribe 82.88ns 82.1631 1.01 78.08ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1322.83ns 2054.43 0.64 3097.45ns
sending of values from observable via buffer to subscriber 5.93ns 6.75985 0.88 86.83ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 218.96ns 237.423 0.92 1390.53ns
long stateful chain creation + subscribe 563.16ns 583.631 0.96 2802.51ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1360.62ns 1318.25 1.03 .
sending of values from observable via combine_latest to subscriber 23.07ns 22.947 1.01 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 4353.07ns 4716.11 0.92 9414.17ns
concat_with 4330.68ns 4762.19 0.91 10675.10ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 161.94ns 150.721 1.07 923.64ns
sending of values from observable via distinct_until_changed to subscriber 2.24ns 2.2608 0.99 1.14ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 123.40ns 124.501 0.99 2162.71ns
sending of values from observable via first to subscriber 0.85ns 0.857241 0.99 0.86ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 62.36ns 62.841 0.99 2144.96ns
error 110.84ns 108.751 1.02 2331.13ns
never 33.72ns 32.6048 1.03 829.00ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 631.22ns 608.315 1.04 3316.21ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 2.28ns 2.24457 1.02 383.86ns
re-schedule 10 times 26.13ns 26.0746 1.00 425.87ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 461.53ns 458.377 1.01 2170.56ns
just send variadic 1783.59ns 1704.78 1.05 2527.04ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 214.42ns 267.268 0.80 1327.31ns
sending of values from observable via last to subscriber 2.54ns 2.55683 0.99 1.29ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 68.02ns 66.2129 1.03 908.28ns
sending of values from observable via map to subscriber 1.13ns 1.12053 1.01 1.43ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 4235.85ns 4362.81 0.97 9372.59ns
merge_with 4117.79ns 4937.93 0.83 10182.60ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 1213.94ns 1179.44 1.03 10755.70ns
sending of values from observable via observe_on to subscriber 229.21ns 227.622 1.01 825.18ns

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 613.03ns 612.029 1.00 1495.10ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 20.81ns 20.8012 1.00 28.40ns
on_error 0.57ns 0.562977 1.01 16.92ns
on_completed 0.60ns 1.25702 0.48 2.24ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 505.26ns 345.308 1.46 606.32ns
get_observable 26.89ns 26.8365 1.00 175.77ns
get_subscriber 52.22ns 51.8043 1.01 77.89ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 5583.81ns 5486.64 1.02 9401.75ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 139.30ns 158.574 0.88 1128.97ns
sending of values from observable via scan to subscriber 3.40ns 2.36164 1.44 1.98ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 1.94ns 1.89514 1.02 .
mutex lock increment 23.94ns 23.1729 1.03 .
spin-lock increment 9.41ns 8.28367 1.14 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 138.14ns 156.737 0.88 1380.23ns
sending of values from observable via skip to subscriber 2.29ns 2.8967 0.79 1.88ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 4619.35ns 4833.84 0.96 10670.00ns
sending of values from observable via switch_on_next to subscriber 968.02ns 973.389 0.99 2602.84ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 194.75ns 209.219 0.93 1814.71ns
sending of values from observable via take to subscriber 2.75ns 2.96074 0.93 5.63ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 302.20ns 314.965 0.96 2017.75ns
sending of values from observable via take_last to subscriber 2.82ns 4.43267 0.64 5.17ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 2346.12ns 2728.19 0.86 4383.25ns
sending of values from observable via take_until to subscriber 7.86ns 8.28437 0.95 2.27ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 6530.13ns 6380.19 1.02 4434.04ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 70.99ns 68.6865 1.03 925.96ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 42.98ns 36.9354 1.16 623.00ns
re-schedule 10 times 88.82ns 90.2602 0.98 665.93ns
recursively schedule 10 times 1863.62ns 2020.21 0.92 15580.40ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 4014.90ns 5982.8 0.67 8324.66ns
sending of values from observable via window to subscriber 837.02ns 2258.6 0.37 1480.62ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1587.02ns 1678.14 0.95 .
sending of values from observable via with_latest_from to subscriber 25.92ns 24.6697 1.05 .

ci-ubuntu-clang

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.40ns 0.402341 1.00 0.40ns
Dynamic observable construction 19.28ns 19.2669 1.00 30.38ns
Specific observable construction + as_dynamic 18.62ns 18.8629 0.99 30.16ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 52.52ns 52.1915 1.01 340.45ns
Specific observable lift dynamic observer 53.50ns 53.3158 1.00 357.10ns
Dynamic observable lift specific observer 82.39ns 83.879 0.98 388.45ns
Dynamic observable lift dynamic observer 79.07ns 78.7508 1.00 371.13ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 33.86ns 32.9617 1.03 338.61ns
Specific observable subscribe dynamic observer 33.52ns 34.9821 0.96 340.78ns
Dynamic observable subscribe specific observer 63.94ns 64.2534 1.00 380.58ns
Dynamic observable subscribe dynamic observer 59.10ns 59.7015 0.99 355.70ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 34.23ns 33.7997 1.01 333.03ns
Dynamic observable subscribe lambda 57.78ns 60.3632 0.96 369.75ns
Specific observable subscribe lambda without subscription 33.38ns 34.6954 0.96 333.73ns
Dynamic observable subscribe lambda without subscription 58.02ns 62.7979 0.92 375.28ns
Specific observable subscribe specific subscriber 13.28ns 14.4821 0.92 273.76ns
Dynamic observable subscribe specific subscriber 40.25ns 39.5676 1.02 314.06ns
Specific observable subscribe dynamic observer 13.27ns 14.4545 0.92 287.22ns
Dynamic observable subscribe dynamic observer 36.18ns 36.6189 0.99 295.70ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.40ns 0.402104 1.00 0.40ns
Dynamic observer construction 18.91ns 19.2899 0.98 25.08ns
Specific observer construction + as_dynamic 18.83ns 19.1658 0.98 25.09ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.80ns 0.444367 1.81 0.44ns
Dynamic observer OnNext 1.61ns 1.60853 1.00 2.01ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 20.70ns 20.0841 1.03 64.25ns
Make copy of subscriber 10.44ns 10.4554 1.00 10.67ns
Transform subsriber to dynamic 20.68ns 20.5234 1.01 28.68ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 20.86ns 20.8765 1.00 57.80ns
composite_subscription add 21.32ns 21.4116 1.00 92.09ns
composite_subscription unsubscribe 26.91ns 26.9198 1.00 26.80ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 725.91ns 740.951 0.98 1963.77ns
sending of values from observable via buffer to subscriber 4.87ns 4.85254 1.00 24.34ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 133.59ns 133.748 1.00 601.13ns
long stateful chain creation + subscribe 152.61ns 157.429 0.97 1365.07ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 416.29ns 413.675 1.01 .
sending of values from observable via combine_latest to subscriber 8.19ns 8.14505 1.01 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 1805.97ns 1853.41 0.97 3890.94ns
concat_with 1668.08ns 1672.58 1.00 4444.07ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 52.65ns 53.4349 0.99 315.03ns
sending of values from observable via distinct_until_changed to subscriber 2.01ns 2.01166 1.00 1.41ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 68.52ns 67.8545 1.01 744.96ns
sending of values from observable via first to subscriber 1.21ns 1.20567 1.00 0.81ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 37.34ns 37.2591 1.00 729.49ns
error 81.06ns 80.4106 1.01 779.72ns
never 14.82ns 14.3343 1.03 283.34ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 230.94ns 234.54 0.98 761.94ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 0.79ns 0.788838 1.00 124.76ns
re-schedule 10 times 7.26ns 7.25783 1.00 152.68ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 193.26ns 193.854 1.00 728.77ns
just send variadic 1137.29ns 1177.15 0.97 807.38ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 89.50ns 87.5619 1.02 446.65ns
sending of values from observable via last to subscriber 3.22ns 3.24154 0.99 1.21ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 40.93ns 40.8538 1.00 305.54ns
sending of values from observable via map to subscriber 0.80ns 0.805197 1.00 1.81ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 1788.21ns 1797.59 0.99 3894.07ns
merge_with 1647.71ns 1652.47 1.00 4345.93ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 546.39ns 538.614 1.01 2746.14ns
sending of values from observable via observe_on to subscriber 123.69ns 122.096 1.01 243.89ns

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 224.94ns 224.169 1.00 771.12ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 20.15ns 20.2077 1.00 13.72ns
on_error 0.81ns 0.80731 1.00 18.98ns
on_completed 0.80ns 0.805971 1.00 0.61ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 116.92ns 118.495 0.99 165.48ns
get_observable 10.69ns 10.7418 1.00 49.33ns
get_subscriber 29.95ns 29.9907 1.00 24.14ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 2110.23ns 2097.79 1.01 3527.95ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 46.71ns 47.0161 0.99 406.70ns
sending of values from observable via scan to subscriber 2.01ns 2.00808 1.00 1.63ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 3.19ns 3.17822 1.00 .
mutex lock increment 6.44ns 6.52479 0.99 .
spin-lock increment 10.43ns 10.4469 1.00 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 47.63ns 47.6384 1.00 570.64ns
sending of values from observable via skip to subscriber 2.49ns 2.46516 1.01 2.55ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 1830.77ns 1825.67 1.00 3834.51ns
sending of values from observable via switch_on_next to subscriber 3654.08ns 3756.07 0.97 879.20ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 81.27ns 82.3892 0.99 601.78ns
sending of values from observable via take to subscriber 2.41ns 2.40977 1.00 2.41ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 107.68ns 109.543 0.98 649.83ns
sending of values from observable via take_last to subscriber 3.26ns 3.25298 1.00 3.97ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 923.62ns 912.758 1.01 1565.42ns
sending of values from observable via take_until to subscriber 10.42ns 10.4521 1.00 2.01ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 797.41ns 792.778 1.01 14598.30ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 42.90ns 43.0236 1.00 17182.30ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 7.23ns 7.67209 0.94 185.24ns
re-schedule 10 times 24.56ns 30.0404 0.82 211.65ns
recursively schedule 10 times 1320.89ns 1300.04 1.02 7501.48ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 1632.60ns 1634.22 1.00 3507.68ns
sending of values from observable via window to subscriber 271.12ns 272.907 0.99 408.78ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 499.32ns 493.461 1.01 .
sending of values from observable via with_latest_from to subscriber 7.67ns 7.64245 1.00 .

ci-ubuntu-gcc

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.33ns 0.33509 1.00 0.33ns
Dynamic observable construction 32.43ns 32.5584 1.00 51.88ns
Specific observable construction + as_dynamic 32.51ns 32.5985 1.00 51.90ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 98.83ns 99.4369 0.99 727.25ns
Specific observable lift dynamic observer 127.62ns 127.693 1.00 775.42ns
Dynamic observable lift specific observer 183.37ns 184.079 1.00 834.67ns
Dynamic observable lift dynamic observer 195.50ns 196.535 0.99 803.33ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 61.84ns 61.7041 1.00 701.45ns
Specific observable subscribe dynamic observer 78.80ns 80.4182 0.98 732.50ns
Dynamic observable subscribe specific observer 132.51ns 132.914 1.00 789.43ns
Dynamic observable subscribe dynamic observer 128.20ns 128.634 1.00 739.64ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 61.94ns 61.7678 1.00 726.76ns
Dynamic observable subscribe lambda 132.83ns 132.962 1.00 784.90ns
Specific observable subscribe lambda without subscription 61.98ns 61.7225 1.00 702.19ns
Dynamic observable subscribe lambda without subscription 132.68ns 133.365 0.99 784.38ns
Specific observable subscribe specific subscriber 30.45ns 30.4293 1.00 597.23ns
Dynamic observable subscribe specific subscriber 113.85ns 99.2984 1.15 681.44ns
Specific observable subscribe dynamic observer 30.47ns 30.4577 1.00 623.97ns
Dynamic observable subscribe dynamic observer 85.08ns 85.1826 1.00 634.65ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.33ns 0.334541 1.00 0.33ns
Dynamic observer construction 32.48ns 32.5753 1.00 45.18ns
Specific observer construction + as_dynamic 32.43ns 32.5504 1.00 47.47ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.34ns 0.335741 1.00 0.33ns
Dynamic observer OnNext 1.67ns 1.67441 1.00 2.01ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 35.49ns 35.5295 1.00 136.33ns
Make copy of subscriber 16.74ns 16.7582 1.00 31.77ns
Transform subsriber to dynamic 46.37ns 46.4423 1.00 78.24ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 35.55ns 35.5633 1.00 129.18ns
composite_subscription add 49.30ns 47.3263 1.04 118.98ns
composite_subscription unsubscribe 43.32ns 43.4265 1.00 38.28ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 952.92ns 950.735 1.00 2924.76ns
sending of values from observable via buffer to subscriber 6.29ns 6.24771 1.01 31.12ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 286.02ns 288.476 0.99 1368.47ns
long stateful chain creation + subscribe 431.02ns 432.862 1.00 4048.29ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 853.32ns 862.015 0.99 .
sending of values from observable via combine_latest to subscriber 9.25ns 9.24584 1.00 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 3134.03ns 2939.5 1.07 7506.33ns
concat_with 2752.03ns 2745.77 1.00 8076.84ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 121.39ns 120.97 1.00 731.74ns
sending of values from observable via distinct_until_changed to subscriber 2.35ns 2.69449 0.87 1.34ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 137.67ns 138.72 0.99 1680.80ns
sending of values from observable via first to subscriber 1.01ns 1.36738 0.74 1.01ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 67.07ns 67.7526 0.99 1728.63ns
error 119.33ns 117.998 1.01 1745.61ns
never 32.90ns 32.3405 1.02 627.60ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 334.07ns 331.45 1.01 1744.08ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.68ns 1.67552 1.00 277.22ns
re-schedule 10 times 22.76ns 22.7665 1.00 308.46ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 302.32ns 299.045 1.01 1744.31ns
just send variadic 1432.88ns 1407.89 1.02 1807.96ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 178.26ns 176.932 1.01 1004.28ns
sending of values from observable via last to subscriber 2.08ns 2.34096 0.89 1.34ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 82.02ns 84.0151 0.98 728.93ns
sending of values from observable via map to subscriber 1.34ns 0.754903 1.77 2.68ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 2918.94ns 2869.77 1.02 9105.34ns
merge_with 2753.57ns 2729.23 1.01 9025.84ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 806.68ns 809.292 1.00 3276.92ns
sending of values from observable via observe_on to subscriber 159.99ns 159.402 1.00 517.11ns

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 441.02ns 440.506 1.00 1493.15ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 22.39ns 22.3955 1.00 15.79ns
on_error 0.67ns 1.01104 0.67 16.88ns
on_completed 1.35ns 0.67317 2.00 0.67ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 216.54ns 213.11 1.02 378.09ns
get_observable 29.44ns 29.4729 1.00 98.04ns
get_subscriber 57.43ns 57.3069 1.00 95.24ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 4174.93ns 4182.44 1.00 7084.47ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 117.32ns 118.849 0.99 898.39ns
sending of values from observable via scan to subscriber 2.34ns 1.69004 1.39 1.62ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.01ns 2.01109 1.00 .
mutex lock increment 8.36ns 8.16454 1.02 .
spin-lock increment 9.04ns 9.03669 1.00 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 115.71ns 117.195 0.99 1090.09ns
sending of values from observable via skip to subscriber 2.74ns 2.36575 1.16 2.34ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 3177.14ns 3129.56 1.02 10537.40ns
sending of values from observable via switch_on_next to subscriber 805.72ns 793.124 1.02 2933.12ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 175.93ns 171.754 1.02 1353.47ns
sending of values from observable via take to subscriber 3.51ns 3.97237 0.88 4.04ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 209.96ns 208.623 1.01 1401.29ns
sending of values from observable via take_last to subscriber 3.37ns 3.1001 1.09 5.93ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1601.92ns 1590.87 1.01 3529.81ns
sending of values from observable via take_until to subscriber 9.04ns 9.02217 1.00 1.86ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1112.44ns 1116.98 1.00 15616.00ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 60.71ns 60.7799 1.00 1798.17ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 21.70ns 22.6782 0.96 366.93ns
re-schedule 10 times 50.61ns 51.2415 0.99 398.47ns
recursively schedule 10 times 1481.06ns 1439.59 1.03 19416.20ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 2742.30ns 2730.5 1.00 6013.26ns
sending of values from observable via window to subscriber 548.33ns 549.88 1.00 946.73ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1058.05ns 1059.98 1.00 .
sending of values from observable via with_latest_from to subscriber 9.51ns 9.16134 1.04 .

ci-windows

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 1.51ns 1.44461 1.05 0.67ns
Dynamic observable construction 80.70ns 51.1272 1.58 123.09ns
Specific observable construction + as_dynamic 80.05ns 52.561 1.52 123.54ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 145.64ns 99.7158 1.46 1237.00ns
Specific observable lift dynamic observer 177.62ns 120.575 1.47 1290.39ns
Dynamic observable lift specific observer 285.08ns 193.882 1.47 1435.00ns
Dynamic observable lift dynamic observer 244.76ns 168.133 1.46 1321.55ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 113.16ns 72.3136 1.56 1188.67ns
Specific observable subscribe dynamic observer 130.51ns 82.6589 1.58 1221.32ns
Dynamic observable subscribe specific observer 229.19ns 149.759 1.53 1367.00ns
Dynamic observable subscribe dynamic observer 202.06ns 120.574 1.68 1263.63ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 113.42ns 70.0476 1.62 1175.16ns
Dynamic observable subscribe lambda 230.76ns 149.636 1.54 1379.73ns
Specific observable subscribe lambda without subscription 119.82ns 70.0627 1.71 1183.20ns
Dynamic observable subscribe lambda without subscription 229.90ns 148.058 1.55 1418.23ns
Specific observable subscribe specific subscriber 30.53ns 19.1175 1.60 860.94ns
Dynamic observable subscribe specific subscriber 161.82ns 95.773 1.69 1141.50ns
Specific observable subscribe dynamic observer 30.68ns 19.0742 1.61 890.54ns
Dynamic observable subscribe dynamic observer 78.87ns 55.9748 1.41 938.75ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 1.53ns 1.43214 1.07 1.52ns
Dynamic observer construction 82.02ns 52.3176 1.57 114.34ns
Specific observer construction + as_dynamic 82.11ns 51.532 1.59 113.44ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.321716 2.09 0.67ns
Dynamic observer OnNext 2.05ns 1.16547 1.76 1.75ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 84.76ns 51.9733 1.63 362.17ns
Make copy of subscriber 17.02ns 11.4657 1.48 31.49ns
Transform subsriber to dynamic 96.44ns 80.6105 1.20 150.16ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 85.18ns 51.414 1.66 345.46ns
composite_subscription add 73.67ns 48.7535 1.51 159.07ns
composite_subscription unsubscribe 64.19ns 45.7698 1.40 127.43ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1108.55ns 735.25 1.51 4631.57ns
sending of values from observable via buffer to subscriber 12.29ns 4.90253 2.51 94.06ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 269.45ns 212.308 1.27 1742.13ns
long stateful chain creation + subscribe 735.32ns 457.027 1.61 3260.57ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1793.69ns 1131.87 1.58 .
sending of values from observable via combine_latest to subscriber 35.47ns 25.6098 1.39 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 7866.00ns 2879.29 2.73 10759.00ns
concat_with 5348.67ns 3003.67 1.78 14851.70ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 195.94ns 126.128 1.55 1039.39ns
sending of values from observable via distinct_until_changed to subscriber 4.53ns 2.32849 1.94 4.35ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 131.18ns 100.396 1.31 2698.60ns
sending of values from observable via first to subscriber 3.28ns 1.76196 1.86 1.73ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 63.30ns 45.3523 1.40 2417.00ns
error 112.46ns 87.9655 1.28 2486.09ns
never 30.88ns 20.5743 1.50 1153.15ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 535.50ns 365.178 1.47 2726.00ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.68ns 1.00383 1.67 411.96ns
re-schedule 10 times 106.46ns 93.1937 1.14 448.51ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 432.32ns 270.8 1.60 2468.27ns
just send variadic 1352.78ns 867.5 1.56 2535.73ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 226.00ns 156.854 1.44 1448.47ns
sending of values from observable via last to subscriber 6.73ns 2.21789 3.04 3.36ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 87.06ns 64.6752 1.35 997.72ns
sending of values from observable via map to subscriber 5.77ns 2.52848 2.28 7.66ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 4091.20ns 2840.29 1.44 11225.70ns
merge_with 9784.00ns 2953.0 3.31 12009.00ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 1234.50ns 871.0 1.42 6340.00ns
sending of values from observable via observe_on to subscriber 210.36ns 137.58 1.53 865.62ns

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 656.68ns 441.333 1.49 1873.25ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 19.91ns 16.1774 1.23 33.92ns
on_error 2.72ns 1.77053 1.54 18.64ns
on_completed 2.31ns 2.12282 1.09 0.68ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 366.63ns 243.581 1.51 611.11ns
get_observable 26.20ns 22.1023 1.19 163.33ns
get_subscriber 51.94ns 44.1172 1.18 95.20ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 7083.00ns 4283.8 1.65 11529.30ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 212.27ns 121.101 1.75 1258.48ns
sending of values from observable via scan to subscriber 6.48ns 3.82655 1.69 8.87ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 1.88ns 2.28296 0.82 .
mutex lock increment 25.58ns 17.1879 1.49 .
spin-lock increment 9.07ns 7.44731 1.22 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 177.28ns 129.489 1.37 1566.06ns
sending of values from observable via skip to subscriber 3.47ns 2.35524 1.47 3.51ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 4875.80ns 3353.5 1.45 23218.30ns
sending of values from observable via switch_on_next to subscriber 1256.53ns 799.75 1.57 3196.00ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 228.73ns 164.624 1.39 2206.67ns
sending of values from observable via take to subscriber 6.40ns 4.37691 1.46 6.49ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 326.67ns 224.264 1.46 2509.09ns
sending of values from observable via take_last to subscriber 4.58ns 2.91696 1.57 21.33ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 2409.30ns 1618.36 1.49 5338.00ns
sending of values from observable via take_until to subscriber 11.49ns 8.77452 1.31 5.68ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1918.36ns 1169.0 1.64 6011.33ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 57.47ns 41.5404 1.38 1439.36ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 18.54ns 13.7758 1.35 621.81ns
re-schedule 10 times 121.71ns 103.854 1.17 649.20ns
recursively schedule 10 times 2654.91ns 1781.64 1.49 20522.00ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 5829.71ns 2615.0 2.23 10104.00ns
sending of values from observable via window to subscriber 829.18ns 591.419 1.40 1660.44ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 2027.70ns 1340.0 1.51 .
sending of values from observable via with_latest_from to subscriber 27.87ns 19.5863 1.42 .

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 16, 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 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@victimsnino victimsnino merged commit 9a0c390 into main Dec 16, 2022
@victimsnino victimsnino deleted the simplify_lift branch December 16, 2022 20:56
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