Skip to content

Commit

Permalink
fix asan in tests (#675)
Browse files Browse the repository at this point in the history
* fix asan in tests

* Update test_scheduler.cpp
  • Loading branch information
victimsnino authored Nov 5, 2024
1 parent 316c991 commit 537ac21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tests/rpp/test_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ TEST_CASE_TEMPLATE("queue_based scheduler", TestType, rpp::schedulers::current_t

auto done = std::make_shared<std::atomic_bool>();

worker->schedule([&](const auto&) {
worker->schedule([done, &thread_of_schedule_promise](const auto&) {
thread_of_schedule_promise.set_value(get_thread_id_as_string(std::this_thread::get_id()));
if constexpr (!std::same_as<TestType, rpp::schedulers::current_thread>)
thread_local rpp::utils::finally_action s_a{[done] {
Expand Down

1 comment on commit 537ac21

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

BENCHMARK RESULTS (AUTOGENERATED)

ci-ubuntu-gcc

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 306.17 ns 1.86 ns 1.71 ns 1.09
Subscribe empty callbacks to empty observable via pipe operator 304.38 ns 1.85 ns 1.72 ns 1.08

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 687.40 ns 0.31 ns 0.28 ns 1.08
from array of 1 - create + subscribe + current_thread 1037.21 ns 3.71 ns 3.41 ns 1.09
concat_as_source of just(1 immediate) create + subscribe 2239.11 ns 138.78 ns 131.03 ns 1.06
defer from array of 1 - defer + create + subscribe + immediate 743.51 ns 0.31 ns 0.30 ns 1.03
interval - interval + take(3) + subscribe + immediate 2137.72 ns 59.23 ns 59.49 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3041.64 ns 32.42 ns 30.07 ns 1.08
from array of 1 - create + as_blocking + subscribe + new_thread 29556.13 ns 27915.38 ns 26067.15 ns 1.07
from array of 1000 - create + as_blocking + subscribe + new_thread 39772.79 ns 49196.96 ns 47843.32 ns 1.03
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3507.47 ns 212.71 ns 195.95 ns 1.09

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1061.88 ns 0.31 ns 0.28 ns 1.08
immediate_just+filter(true)+subscribe 837.84 ns 0.31 ns 0.28 ns 1.08
immediate_just(1,2)+skip(1)+subscribe 971.75 ns 0.31 ns 0.28 ns 1.10
immediate_just(1,1,2)+distinct_until_changed()+subscribe 855.01 ns 0.31 ns 0.28 ns 1.08
immediate_just(1,2)+first()+subscribe 1225.06 ns 0.31 ns 0.28 ns 1.08
immediate_just(1,2)+last()+subscribe 919.25 ns 0.31 ns 0.28 ns 1.08
immediate_just+take_last(1)+subscribe 1114.00 ns 18.22 ns 16.78 ns 1.09
immediate_just(1,2,3)+element_at(1)+subscribe 864.12 ns 0.31 ns 0.28 ns 1.08

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 267.20 ns 0.46 ns 1.43 ns 0.32
current_thread scheduler create worker + schedule 370.00 ns 4.32 ns 3.99 ns 1.08
current_thread scheduler create worker + schedule + recursive schedule 820.93 ns 61.27 ns 56.03 ns 1.09

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 842.57 ns 0.31 ns 0.28 ns 1.08
immediate_just+scan(10, std::plus)+subscribe 910.17 ns 0.31 ns 0.28 ns 1.08
immediate_just+flat_map(immediate_just(v*2))+subscribe 2327.27 ns 180.28 ns 165.72 ns 1.09
immediate_just+buffer(2)+subscribe 1527.03 ns 13.91 ns 12.81 ns 1.09
immediate_just+window(2)+subscribe + subscsribe inner 2388.16 ns 1300.08 ns 1194.18 ns 1.09

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 818.24 ns - - 0.00
immediate_just+take_while(true)+subscribe 840.91 ns 0.31 ns 0.28 ns 1.08

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 1985.56 ns 0.31 ns 0.28 ns 1.08

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 3443.31 ns 231.90 ns 213.50 ns 1.09
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3631.57 ns 175.43 ns 161.82 ns 1.08
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 178.29 ns 168.75 ns 1.06
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3492.55 ns 1160.32 ns 1068.38 ns 1.09
immediate_just(1) + zip(immediate_just(2)) + subscribe 2084.59 ns 229.42 ns 205.77 ns 1.11

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 34.58 ns 17.49 ns 13.53 ns 1.29
subscribe 100 observers to publish_subject 199432.00 ns 15994.52 ns 15167.09 ns 1.05
100 on_next to 100 observers to publish_subject 32655.06 ns 17251.06 ns 17383.18 ns 0.99

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1324.12 ns 12.97 ns 11.95 ns 1.09
basic sample with immediate scheduler 1430.99 ns 5.24 ns 4.84 ns 1.08

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 916.63 ns 0.31 ns 0.28 ns 1.09

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 2042.50 ns 886.51 ns 869.04 ns 1.02
create(on_error())+retry(1)+subscribe 596.52 ns 121.29 ns 112.55 ns 1.08

ci-macos

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 978.78 ns 0.47 ns 0.47 ns 0.99
Subscribe empty callbacks to empty observable via pipe operator 978.34 ns 0.47 ns 0.51 ns 0.91

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1927.19 ns 0.23 ns 0.23 ns 0.99
from array of 1 - create + subscribe + current_thread 2426.60 ns 32.34 ns 32.43 ns 1.00
concat_as_source of just(1 immediate) create + subscribe 5428.57 ns 414.20 ns 416.97 ns 0.99
defer from array of 1 - defer + create + subscribe + immediate 1987.62 ns 0.24 ns 0.23 ns 1.01
interval - interval + take(3) + subscribe + immediate 5067.84 ns 112.75 ns 112.57 ns 1.00
interval - interval + take(3) + subscribe + current_thread 6065.93 ns 95.28 ns 97.10 ns 0.98
from array of 1 - create + as_blocking + subscribe + new_thread 83136.08 ns 81508.85 ns 121684.40 ns 0.67
from array of 1000 - create + as_blocking + subscribe + new_thread 90592.00 ns 87314.92 ns 140495.10 ns 0.62
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 8215.49 ns 586.52 ns 582.02 ns 1.01

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 3197.20 ns 0.25 ns 0.23 ns 1.05
immediate_just+filter(true)+subscribe 2328.81 ns 0.26 ns 0.24 ns 1.10
immediate_just(1,2)+skip(1)+subscribe 3069.50 ns 0.27 ns 0.24 ns 1.13
immediate_just(1,1,2)+distinct_until_changed()+subscribe 2254.59 ns 0.50 ns 0.47 ns 1.07
immediate_just(1,2)+first()+subscribe 3435.87 ns 0.25 ns 0.24 ns 1.08
immediate_just(1,2)+last()+subscribe 2658.18 ns 0.25 ns 0.23 ns 1.08
immediate_just+take_last(1)+subscribe 3418.99 ns 0.25 ns 0.23 ns 1.09
immediate_just(1,2,3)+element_at(1)+subscribe 2338.22 ns 0.26 ns 0.23 ns 1.10

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 866.43 ns 0.51 ns 0.47 ns 1.10
current_thread scheduler create worker + schedule 1183.16 ns 33.83 ns 33.61 ns 1.01
current_thread scheduler create worker + schedule + recursive schedule 2015.29 ns 200.50 ns 203.10 ns 0.99

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 2377.73 ns 4.92 ns 4.43 ns 1.11
immediate_just+scan(10, std::plus)+subscribe 2598.67 ns 0.54 ns 0.47 ns 1.16
immediate_just+flat_map(immediate_just(v*2))+subscribe 5722.70 ns 540.66 ns 492.31 ns 1.10
immediate_just+buffer(2)+subscribe 2647.29 ns 69.19 ns 65.49 ns 1.06
immediate_just+window(2)+subscribe + subscsribe inner 5726.28 ns 2502.32 ns 2339.18 ns 1.07

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 2272.59 ns - - 0.00
immediate_just+take_while(true)+subscribe 2376.59 ns 0.25 ns 0.24 ns 1.04

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 5710.13 ns 5.43 ns 4.91 ns 1.11

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 7449.39 ns 565.72 ns 569.85 ns 0.99
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 8488.07 ns 485.92 ns 485.85 ns 1.00
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 592.54 ns 576.90 ns 1.03
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 8254.92 ns 2012.73 ns 1906.09 ns 1.06
immediate_just(1) + zip(immediate_just(2)) + subscribe 5508.38 ns 958.41 ns 911.74 ns 1.05

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 85.26 ns 61.93 ns 50.19 ns 1.23
subscribe 100 observers to publish_subject 379525.33 ns 43801.23 ns 40603.39 ns 1.08
100 on_next to 100 observers to publish_subject 59347.95 ns 24977.05 ns 23501.91 ns 1.06

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 3077.73 ns 80.17 ns 72.14 ns 1.11
basic sample with immediate scheduler 2966.96 ns 21.20 ns 18.83 ns 1.13

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 2615.53 ns 0.26 ns 0.23 ns 1.11

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 7060.07 ns 4109.18 ns 4122.65 ns 1.00
create(on_error())+retry(1)+subscribe 1914.77 ns 385.38 ns 374.62 ns 1.03

ci-ubuntu-clang

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 274.86 ns 1.54 ns 1.54 ns 1.00
Subscribe empty callbacks to empty observable via pipe operator 272.57 ns 1.54 ns 1.54 ns 1.00

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 560.32 ns 0.31 ns 0.31 ns 1.00
from array of 1 - create + subscribe + current_thread 788.10 ns 4.63 ns 4.68 ns 0.99
concat_as_source of just(1 immediate) create + subscribe 2348.41 ns 181.49 ns 179.23 ns 1.01
defer from array of 1 - defer + create + subscribe + immediate 778.00 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2228.22 ns 58.30 ns 58.27 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3201.10 ns 30.88 ns 30.88 ns 1.00
from array of 1 - create + as_blocking + subscribe + new_thread 29970.97 ns 27348.24 ns 28425.74 ns 0.96
from array of 1000 - create + as_blocking + subscribe + new_thread 38177.18 ns 35029.23 ns 37968.93 ns 0.92
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3678.00 ns 302.52 ns 301.32 ns 1.00

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1143.18 ns 0.31 ns 0.31 ns 1.00
immediate_just+filter(true)+subscribe 846.05 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 1101.26 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 870.32 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+first()+subscribe 1376.75 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+last()+subscribe 999.68 ns 0.31 ns 0.31 ns 1.00
immediate_just+take_last(1)+subscribe 1200.60 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2,3)+element_at(1)+subscribe 867.17 ns 0.31 ns 0.31 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 278.98 ns 0.63 ns 0.63 ns 1.00
current_thread scheduler create worker + schedule 394.13 ns 4.32 ns 4.32 ns 1.00
current_thread scheduler create worker + schedule + recursive schedule 853.22 ns 55.14 ns 53.89 ns 1.02

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 844.03 ns 0.31 ns 0.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 984.35 ns 0.31 ns 0.31 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 2196.59 ns 224.31 ns 223.05 ns 1.01
immediate_just+buffer(2)+subscribe 1521.11 ns 14.20 ns 14.20 ns 1.00
immediate_just+window(2)+subscribe + subscsribe inner 2431.42 ns 904.53 ns 898.64 ns 1.01

Conditional Operators

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

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2027.45 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 3270.35 ns 278.79 ns 280.08 ns 1.00
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3703.79 ns 207.20 ns 212.01 ns 0.98
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 194.55 ns 193.39 ns 1.01
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3373.41 ns 833.09 ns 834.94 ns 1.00
immediate_just(1) + zip(immediate_just(2)) + subscribe 2203.55 ns 191.94 ns 191.60 ns 1.00

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 54.28 ns 17.26 ns 17.56 ns 0.98
subscribe 100 observers to publish_subject 207688.33 ns 16133.48 ns 16104.37 ns 1.00
100 on_next to 100 observers to publish_subject 35394.90 ns 20621.47 ns 23437.48 ns 0.88

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1296.70 ns 12.35 ns 12.34 ns 1.00
basic sample with immediate scheduler 1312.16 ns 5.86 ns 5.86 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1039.17 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 2175.29 ns 1027.69 ns 995.92 ns 1.03
create(on_error())+retry(1)+subscribe 668.65 ns 161.59 ns 155.18 ns 1.04

ci-windows

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 572.79 ns 2.16 ns 2.16 ns 1.00
Subscribe empty callbacks to empty observable via pipe operator 583.32 ns 2.16 ns 2.16 ns 1.00

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1167.47 ns 5.24 ns 5.24 ns 1.00
from array of 1 - create + subscribe + current_thread 1507.98 ns 15.53 ns 15.40 ns 1.01
concat_as_source of just(1 immediate) create + subscribe 5660.81 ns 239.33 ns 258.05 ns 0.93
defer from array of 1 - defer + create + subscribe + immediate 1195.47 ns 8.42 ns 4.93 ns 1.71
interval - interval + take(3) + subscribe + immediate 3405.96 ns 139.94 ns 140.05 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3386.12 ns 74.82 ns 59.27 ns 1.26
from array of 1 - create + as_blocking + subscribe + new_thread 124387.50 ns 124587.50 ns 117966.67 ns 1.06
from array of 1000 - create + as_blocking + subscribe + new_thread 131500.00 ns 134862.50 ns 137587.50 ns 0.98
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 5318.67 ns 307.90 ns 306.12 ns 1.01

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1840.30 ns 19.44 ns 19.42 ns 1.00
immediate_just+filter(true)+subscribe 1403.81 ns 18.59 ns 18.50 ns 1.01
immediate_just(1,2)+skip(1)+subscribe 1734.68 ns 17.91 ns 17.89 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 1366.63 ns 20.68 ns 20.70 ns 1.00
immediate_just(1,2)+first()+subscribe 2046.24 ns 18.20 ns 18.21 ns 1.00
immediate_just(1,2)+last()+subscribe 1794.97 ns 19.14 ns 19.12 ns 1.00
immediate_just+take_last(1)+subscribe 3510.78 ns 116.95 ns 64.53 ns 1.81
immediate_just(1,2,3)+element_at(1)+subscribe 1346.76 ns 20.99 ns 21.00 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 474.31 ns 4.32 ns 4.32 ns 1.00
current_thread scheduler create worker + schedule 1140.08 ns 12.00 ns 11.12 ns 1.08
current_thread scheduler create worker + schedule + recursive schedule 1377.08 ns 100.00 ns 99.87 ns 1.00

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 1335.77 ns 20.95 ns 18.82 ns 1.11
immediate_just+scan(10, std::plus)+subscribe 1460.20 ns 20.98 ns 20.96 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 3613.65 ns 278.80 ns 275.47 ns 1.01
immediate_just+buffer(2)+subscribe 2639.19 ns 63.91 ns 63.81 ns 1.00
immediate_just+window(2)+subscribe + subscsribe inner 4002.98 ns 1336.08 ns 1316.15 ns 1.02

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 2860.15 ns 17.57 ns 17.57 ns 1.00
immediate_just+take_while(true)+subscribe 1792.00 ns 18.50 ns 18.50 ns 1.00

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 3486.44 ns 11.10 ns 11.10 ns 1.00

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 5097.04 ns 569.76 ns 298.62 ns 1.91
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 5361.50 ns 278.10 ns 270.45 ns 1.03
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 302.33 ns 302.19 ns 1.00
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 10100.00 ns 1782.31 ns 945.25 ns 1.89
immediate_just(1) + zip(immediate_just(2)) + subscribe 3531.69 ns 649.78 ns 557.55 ns 1.17

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 37.35 ns 20.65 ns 20.67 ns 1.00
subscribe 100 observers to publish_subject 260780.00 ns 28194.74 ns 26753.49 ns 1.05
100 on_next to 100 observers to publish_subject 51886.96 ns 35760.61 ns 35737.93 ns 1.00

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1894.57 ns 96.65 ns 100.74 ns 0.96
basic sample with immediate scheduler 1873.94 ns 66.99 ns 68.59 ns 0.98

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1457.20 ns 19.11 ns 19.11 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 2173.42 ns 247.29 ns 245.63 ns 1.01
create(on_error())+retry(1)+subscribe 1214.07 ns 196.98 ns 206.22 ns 0.96

Please sign in to comment.