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 new benchmarks + speedup #562

Merged
merged 15 commits into from
Apr 19, 2024
Merged

Add new benchmarks + speedup #562

merged 15 commits into from
Apr 19, 2024

Conversation

victimsnino
Copy link
Owner

No description provided.

Copy link
Contributor

github-actions bot commented Apr 18, 2024

BENCHMARK RESULTS (AUTOGENERATED)

ci-ubuntu-gcc

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 308.14 ns 2.16 ns 2.22 ns 0.97
Subscribe empty callbacks to empty observable via pipe operator 302.87 ns 2.16 ns 2.16 ns 1.00

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 694.73 ns 0.62 ns 0.31 ns 2.00
from array of 1 - create + subscribe + current_thread 1071.59 ns 3.43 ns 5.25 ns 0.65
concat_as_source of just(1 immediate) create + subscribe 2236.75 ns 154.67 ns 133.05 ns 1.16
defer from array of 1 - defer + create + subscribe + immediate 729.11 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2148.45 ns 59.19 ns 59.19 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3031.25 ns 32.40 ns 32.76 ns 0.99
from array of 1 - create + as_blocking + subscribe + new_thread 27728.18 ns 27706.24 ns - 0.00
from array of 1000 - create + as_blocking + subscribe + new_thread 41066.25 ns 51364.40 ns - 0.00

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1094.01 ns 0.31 ns 0.31 ns 1.00
immediate_just+filter(true)+subscribe 831.50 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 992.38 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 845.99 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+first()+subscribe 1236.49 ns 0.62 ns 0.31 ns 2.00
immediate_just(1,2)+last()+subscribe 937.32 ns 0.31 ns 0.31 ns 1.00
immediate_just+take_last(1)+subscribe 1117.71 ns 17.90 ns 18.82 ns 0.95

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 263.18 ns 4.09 ns 2.16 ns 1.89
current_thread scheduler create worker + schedule 370.16 ns 6.17 ns 7.42 ns 0.83
current_thread scheduler create worker + schedule + recursive schedule 845.73 ns 56.63 ns 64.44 ns 0.88

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 844.86 ns 0.31 ns 0.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 889.86 ns 0.31 ns 0.31 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 2338.85 ns 163.15 ns 173.60 ns 0.94
immediate_just+buffer(2)+subscribe 1543.80 ns 13.58 ns 14.51 ns 0.94
immediate_just+window(2)+subscribe + subscsribe inner 2367.41 ns 1084.95 ns 1075.73 ns 1.01

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 839.59 ns - - 0.00
immediate_just+take_while(true)+subscribe 829.98 ns 0.31 ns 0.31 ns 1.00

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2029.50 ns 0.31 ns 0.31 ns 1.00

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 3445.99 ns 188.78 ns 196.34 ns 0.96
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3713.84 ns 166.83 ns 173.92 ns 0.96
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 174.84 ns 150.82 ns 1.16
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3568.33 ns 1033.26 ns 992.26 ns 1.04
immediate_just(1) + zip(immediate_just(2)) + subscribe 2115.33 ns 242.76 ns 211.31 ns 1.15

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 34.53 ns 16.78 ns 12.02 ns 1.40

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1431.01 ns 13.27 ns 16.37 ns 0.81
basic sample with immediate scheduler 1377.52 ns 5.55 ns 5.55 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 921.98 ns 0.31 ns 0.31 ns 1.00

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 1060.53 ns 129.16 ns 121.65 ns 1.06

ci-macos

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 1257.35 ns 5.38 ns 3.85 ns 1.40
Subscribe empty callbacks to empty observable via pipe operator 1075.65 ns 5.39 ns 3.89 ns 1.38

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 2254.20 ns 0.45 ns 0.23 ns 1.90
from array of 1 - create + subscribe + current_thread 2854.10 ns 10.89 ns 25.29 ns 0.43
concat_as_source of just(1 immediate) create + subscribe 7203.31 ns 412.30 ns 333.65 ns 1.24
defer from array of 1 - defer + create + subscribe + immediate 2352.38 ns 0.29 ns 0.24 ns 1.21
interval - interval + take(3) + subscribe + immediate 7760.31 ns 93.52 ns 117.21 ns 0.80
interval - interval + take(3) + subscribe + current_thread 7806.69 ns 61.17 ns 107.01 ns 0.57
from array of 1 - create + as_blocking + subscribe + new_thread 63266.88 ns 59071.15 ns - 0.00
from array of 1000 - create + as_blocking + subscribe + new_thread 77988.23 ns 71067.06 ns - 0.00

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 3397.26 ns 0.29 ns 0.23 ns 1.25
immediate_just+filter(true)+subscribe 2671.36 ns 0.28 ns 0.23 ns 1.22
immediate_just(1,2)+skip(1)+subscribe 3492.79 ns 0.28 ns 0.23 ns 1.22
immediate_just(1,1,2)+distinct_until_changed()+subscribe 2491.32 ns 0.58 ns 0.47 ns 1.25
immediate_just(1,2)+first()+subscribe 3842.00 ns 0.29 ns 0.23 ns 1.22
immediate_just(1,2)+last()+subscribe 2832.19 ns 0.28 ns 0.23 ns 1.20
immediate_just+take_last(1)+subscribe 3563.80 ns 79.57 ns 71.09 ns 1.12

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 1004.72 ns 5.93 ns 4.04 ns 1.47
current_thread scheduler create worker + schedule 1298.53 ns 16.17 ns 40.73 ns 0.40
current_thread scheduler create worker + schedule + recursive schedule 2290.83 ns 155.36 ns 220.73 ns 0.70

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 2778.87 ns 0.30 ns 0.23 ns 1.27
immediate_just+scan(10, std::plus)+subscribe 2822.43 ns 0.60 ns 0.47 ns 1.29
immediate_just+flat_map(immediate_just(v*2))+subscribe 7724.48 ns 604.99 ns 413.68 ns 1.46
immediate_just+buffer(2)+subscribe 3034.55 ns 77.22 ns 68.63 ns 1.13
immediate_just+window(2)+subscribe + subscsribe inner 7052.89 ns 2882.91 ns 2295.55 ns 1.26

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 2465.21 ns - - 0.00
immediate_just+take_while(true)+subscribe 2618.19 ns 0.28 ns 0.23 ns 1.20

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 5869.38 ns 0.28 ns 0.23 ns 1.20

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 9115.86 ns 507.62 ns 449.18 ns 1.13
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 10957.45 ns 546.25 ns 444.96 ns 1.23
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 539.87 ns 475.49 ns 1.14
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 10201.88 ns 2483.13 ns 1908.91 ns 1.30
immediate_just(1) + zip(immediate_just(2)) + subscribe 6586.89 ns 966.39 ns 832.28 ns 1.16

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 99.92 ns 62.01 ns 49.56 ns 1.25

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 3438.76 ns 38.86 ns 102.34 ns 0.38
basic sample with immediate scheduler 3906.41 ns 6.95 ns 15.51 ns 0.45

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 2823.23 ns 0.28 ns 0.24 ns 1.15

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 8272.22 ns 5105.98 ns 4147.98 ns 1.23

ci-ubuntu-clang

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 271.15 ns 1.56 ns 0.89 ns 1.76
Subscribe empty callbacks to empty observable via pipe operator 274.56 ns 1.56 ns 0.88 ns 1.77

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 562.32 ns 0.31 ns 0.31 ns 1.00
from array of 1 - create + subscribe + current_thread 787.88 ns 4.01 ns 5.55 ns 0.72
concat_as_source of just(1 immediate) create + subscribe 2360.58 ns 135.28 ns 114.06 ns 1.19
defer from array of 1 - defer + create + subscribe + immediate 775.54 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2238.29 ns 58.30 ns 58.26 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3172.42 ns 31.19 ns 31.47 ns 0.99
from array of 1 - create + as_blocking + subscribe + new_thread 29460.79 ns 27443.77 ns - 0.00
from array of 1000 - create + as_blocking + subscribe + new_thread 35553.38 ns 35836.88 ns - 0.00

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1151.49 ns 0.31 ns 0.31 ns 1.00
immediate_just+filter(true)+subscribe 843.07 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 1085.68 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 882.70 ns 0.31 ns 0.62 ns 0.50
immediate_just(1,2)+first()+subscribe 1428.97 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+last()+subscribe 996.25 ns 0.31 ns 0.31 ns 1.00
immediate_just+take_last(1)+subscribe 1182.42 ns 0.31 ns 0.31 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 277.92 ns 1.56 ns 0.88 ns 1.78
current_thread scheduler create worker + schedule 394.17 ns 4.02 ns 5.89 ns 0.68
current_thread scheduler create worker + schedule + recursive schedule 859.36 ns 57.92 ns 59.96 ns 0.97

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 848.03 ns 0.31 ns 0.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 964.55 ns 0.62 ns 0.31 ns 2.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 2239.79 ns 138.39 ns 116.36 ns 1.19
immediate_just+buffer(2)+subscribe 1526.81 ns 13.89 ns 14.50 ns 0.96
immediate_just+window(2)+subscribe + subscsribe inner 2448.86 ns 882.92 ns 822.02 ns 1.07

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 825.21 ns - - 0.00
immediate_just+take_while(true)+subscribe 840.21 ns 0.31 ns 0.31 ns 1.00

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 1979.96 ns 0.31 ns 0.31 ns 1.00

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 3251.12 ns 160.45 ns 123.43 ns 1.30
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3686.53 ns 149.29 ns 119.20 ns 1.25
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 142.45 ns 109.41 ns 1.30
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3383.77 ns 848.37 ns 730.00 ns 1.16
immediate_just(1) + zip(immediate_just(2)) + subscribe 2254.74 ns 198.80 ns 168.72 ns 1.18

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 52.62 ns 19.07 ns 13.57 ns 1.40

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1295.42 ns 11.11 ns 13.88 ns 0.80
basic sample with immediate scheduler 1286.83 ns 6.17 ns 5.86 ns 1.05

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 990.34 ns 0.31 ns 0.31 ns 1.00

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 1048.11 ns 134.80 ns 123.98 ns 1.09

ci-windows

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 595.07 ns 4.01 ns 4.01 ns 1.00
Subscribe empty callbacks to empty observable via pipe operator 600.16 ns 4.01 ns 4.01 ns 1.00

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1245.31 ns 6.01 ns 5.55 ns 1.08
from array of 1 - create + subscribe + current_thread 1571.95 ns 15.43 ns 19.20 ns 0.80
concat_as_source of just(1 immediate) create + subscribe 3859.80 ns 187.35 ns 175.93 ns 1.06
defer from array of 1 - defer + create + subscribe + immediate 1234.35 ns 5.24 ns 5.55 ns 0.94
interval - interval + take(3) + subscribe + immediate 3142.42 ns 134.39 ns 134.24 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3822.06 ns 53.47 ns 57.89 ns 0.92
from array of 1 - create + as_blocking + subscribe + new_thread 121788.89 ns 116010.00 ns - 0.00
from array of 1000 - create + as_blocking + subscribe + new_thread 131800.00 ns 131566.67 ns - 0.00

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1864.41 ns 12.87 ns 12.87 ns 1.00
immediate_just+filter(true)+subscribe 1593.00 ns 12.39 ns 12.36 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 2085.31 ns 13.05 ns 13.11 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 1385.52 ns 15.94 ns 15.94 ns 1.00
immediate_just(1,2)+first()+subscribe 2100.20 ns 12.64 ns 12.64 ns 1.00
immediate_just(1,2)+last()+subscribe 1769.44 ns 14.11 ns 14.07 ns 1.00
immediate_just+take_last(1)+subscribe 2090.87 ns 59.59 ns 61.34 ns 0.97

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 513.83 ns 6.17 ns 6.18 ns 1.00
current_thread scheduler create worker + schedule 674.11 ns 13.35 ns 28.62 ns 0.47
current_thread scheduler create worker + schedule + recursive schedule 1119.91 ns 105.82 ns 115.63 ns 0.92

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 1354.37 ns 12.34 ns 12.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 1469.10 ns 21.27 ns 21.29 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 3667.68 ns 232.81 ns 233.56 ns 1.00
immediate_just+buffer(2)+subscribe 2372.62 ns 59.03 ns 61.04 ns 0.97
immediate_just+window(2)+subscribe + subscsribe inner 4202.98 ns 1230.51 ns 1581.80 ns 0.78

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 1343.99 ns 11.46 ns 11.46 ns 1.00
immediate_just+take_while(true)+subscribe 1369.90 ns 12.39 ns 12.35 ns 1.00

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 3258.24 ns 7.71 ns 7.71 ns 1.00

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 6315.06 ns 240.94 ns 248.46 ns 0.97
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 6062.70 ns 238.33 ns 250.65 ns 0.95
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 223.58 ns 243.38 ns 0.92
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 5684.92 ns 949.83 ns 977.26 ns 0.97
immediate_just(1) + zip(immediate_just(2)) + subscribe 3694.48 ns 536.56 ns 536.00 ns 1.00

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 36.53 ns 25.90 ns 27.15 ns 0.95

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1918.03 ns 56.80 ns 59.14 ns 0.96
basic sample with immediate scheduler 1934.23 ns 35.79 ns 35.50 ns 1.01

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1487.94 ns 17.81 ns 17.81 ns 1.00

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 1960.92 ns 339.10 ns 344.18 ns 0.99

Copy link

@victimsnino victimsnino marked this pull request as ready for review April 19, 2024 11:31
@victimsnino victimsnino merged commit 245e40e into v2 Apr 19, 2024
27 checks passed
@victimsnino victimsnino deleted the new_benchmarks branch April 19, 2024 11:31
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