Skip to content

Commit

Permalink
add some extra benchmaks (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
victimsnino authored Jul 28, 2022
1 parent c6e60d7 commit f4ac15e
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 7 deletions.
83 changes: 83 additions & 0 deletions src/tests/benchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,21 @@ TEST_CASE("map")
}).subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via map to subscriber")(Catch::Benchmark::Chronometer meter)
{
rpp::source::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
})
.map([](const auto& v)
{
return v * 100;
}).subscribe([](const auto&) {});
};
}

TEST_CASE("scan")
Expand All @@ -283,6 +298,22 @@ TEST_CASE("scan")
}).subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via scan to subscriber")(Catch::Benchmark::Chronometer meter)
{
rpp::observable::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
})
.scan(std::vector<int>{},
[](std::vector<int>&& seed, const auto& v)
{
return std::move(seed);
}).subscribe([](const auto&) {});
};
}

TEST_CASE("distinct_until_changed")
Expand All @@ -302,6 +333,18 @@ TEST_CASE("distinct_until_changed")
return obs.distinct_until_changed().subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via distinct_until_changed to subscriber")(Catch::Benchmark::Chronometer meter)
{
rpp::observable::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
})
.distinct_until_changed().subscribe([](const auto&) {});
};
}

TEST_CASE("with_latest_from")
Expand All @@ -319,6 +362,19 @@ TEST_CASE("with_latest_from")
return obs.with_latest_from(obs, obs).subscribe(sub);
});
};


BENCHMARK_ADVANCED("sending of values from observable via with_latest_from to subscriber")(Catch::Benchmark::Chronometer meter)
{
rpp::observable::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
})
.with_latest_from(rpp::source::just(1)).subscribe([](const auto&) {});
};
}

TEST_CASE("switch_on_next")
Expand All @@ -340,6 +396,21 @@ TEST_CASE("switch_on_next")
return obs.switch_on_next().subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via switch_on_next to subscriber")(Catch::Benchmark::Chronometer meter)
{
auto inner_source = rpp::source::just(1);
using inner_source_type = decltype(inner_source);

rpp::observable::create<inner_source_type>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(inner_source);
});
})
.switch_on_next().subscribe([](const auto&) {});
};
}

TEST_CASE("observe_on")
Expand All @@ -359,6 +430,18 @@ TEST_CASE("observe_on")
return obs.observe_on(scheduler).subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via observe_on to subscriber")(Catch::Benchmark::Chronometer meter)
{
rpp::observable::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
})
.observe_on(rpp::schedulers::immediate{}).subscribe([](const auto&) {});
};
}

TEST_CASE("repeat")
Expand Down
100 changes: 93 additions & 7 deletions src/tests/rxcpp_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,32 @@ TEST_CASE("map")
BENCHMARK_ADVANCED("map construction from observable via dot + subscribe")(Catch::Benchmark::Chronometer meter)
{
const auto obs = rxcpp::sources::create<int>([](const auto& sub)
{
sub.on_next(1);
});
{
sub.on_next(1);
});
auto sub = rxcpp::make_subscriber<int>([](const int&) {});

meter.measure([&]
{
return obs.map([](const auto& v)
{
return obs.map([](const auto& v)
{
return v * 100;
}).subscribe(sub);
return v * 100;
}).subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via map to subscriber")(Catch::Benchmark::Chronometer meter)
{
rxcpp::sources::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
}).map([](const auto& v)
{
return v * 100;
}).subscribe([](const auto&) {});
};
}

Expand All @@ -275,6 +289,23 @@ TEST_CASE("scan")
}).subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via scan to subscriber")(Catch::Benchmark::Chronometer meter)
{
rxcpp::sources::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
})
.scan(std::vector<int>{},
[](std::vector<int>&& seed, const auto& v)
{
return std::move(seed);
})
.subscribe([](const auto&) {});
};
}

TEST_CASE("distinct_until_changed")
Expand All @@ -294,6 +325,19 @@ TEST_CASE("distinct_until_changed")
return obs.distinct_until_changed().subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via distinct_until_changed to subscriber")(Catch::Benchmark::Chronometer meter)
{
rxcpp::sources::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
})
.distinct_until_changed()
.subscribe([](const auto&) {});
};
}

TEST_CASE("with_latest_from")
Expand All @@ -311,6 +355,19 @@ TEST_CASE("with_latest_from")
return obs.with_latest_from(obs,obs).subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via with_latest_from to subscriber")(Catch::Benchmark::Chronometer meter)
{
rxcpp::sources::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
})
.with_latest_from(rxcpp::sources::just(1))
.subscribe([](const auto&) {});
};
}

TEST_CASE("switch_on_next")
Expand All @@ -333,6 +390,22 @@ TEST_CASE("switch_on_next")
return obs.switch_on_next().subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via switch_on_next to subscriber")(Catch::Benchmark::Chronometer meter)
{
auto inner_source = rxcpp::sources::just(1);
using inner_source_type = decltype(inner_source);

rxcpp::sources::create<inner_source_type>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(inner_source);
});
})
.switch_on_next()
.subscribe([](const auto&) {});
};
}

TEST_CASE("observe_on")
Expand All @@ -352,6 +425,19 @@ TEST_CASE("observe_on")
return obs.observe_on(scheduler).subscribe(sub);
});
};

BENCHMARK_ADVANCED("sending of values from observable via observe_on to subscriber")(Catch::Benchmark::Chronometer meter)
{
rxcpp::sources::create<int>([&](const auto& sub)
{
meter.measure([&]
{
sub.on_next(1);
});
})
.observe_on(rxcpp::identity_immediate())
.subscribe([](const auto&) {});
};
}

TEST_CASE("repeat")
Expand Down

1 comment on commit f4ac15e

@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.

Linux CLANG

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.34ns 0.286602 1.17 0.34ns
Dynamic observable construction 29.14ns 22.7383 1.28 24.21ns
Specific observable construction + as_dynamic 29.16ns 20.4329 1.43 24.49ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 71.01ns 55.6542 1.28 291.58ns
Specific observable lift dynamic observer 94.62ns 75.2073 1.26 309.50ns
Dynamic observable lift specific observer 157.98ns 114.441 1.38 334.64ns
Dynamic observable lift dynamic observer 163.72ns 126.477 1.29 323.95ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 45.15ns 34.7605 1.30 285.04ns
Specific observable subscribe dynamic observer 58.21ns 43.7621 1.33 296.09ns
Dynamic observable subscribe specific observer 112.33ns 79.4126 1.41 327.67ns
Dynamic observable subscribe dynamic observer 109.25ns 82.3319 1.33 317.85ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 48.60ns 36.7528 1.32 287.06ns
Dynamic observable subscribe lambda 115.04ns 80.9105 1.42 327.49ns
Specific observable subscribe lambda without subscription 48.49ns 36.7558 1.32 284.11ns
Dynamic observable subscribe lambda without subscription 115.04ns 81.3026 1.42 342.46ns
Specific observable subscribe specific subscriber 16.75ns 11.4933 1.46 225.23ns
Dynamic observable subscribe specific subscriber 78.71ns 55.0477 1.43 266.81ns
Specific observable subscribe dynamic observer 16.74ns 11.499 1.46 238.79ns
Dynamic observable subscribe dynamic observer 63.51ns 48.4357 1.31 257.75ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.67ns 0.287806 2.33 0.34ns
Dynamic observer construction 29.16ns 22.3815 1.30 21.90ns
Specific observer construction + as_dynamic 29.10ns 21.6815 1.34 21.50ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.316255 2.12 0.67ns
Dynamic observer OnNext 1.68ns 1.43375 1.17 2.68ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 36.44ns 24.0402 1.52 65.88ns
Make copy of subscriber 16.72ns 11.4616 1.46 4.70ns
Transform subsriber to dynamic 46.48ns 33.587 1.38 27.50ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 36.54ns 25.2982 1.44 53.11ns
composite_subscription add 45.75ns 32.6889 1.40 20.54ns
composite_subscription unsubscribe 6.04ns 5.74372 1.05 9.70ns

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 17.40ns 12.0034 1.45 125.45ns
concat_with 79.20ns 54.8334 1.44 300.80ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 118.82ns 84.2499 1.41 252.05ns
sending of values from observable via distinct_until_changed to subscriber 3.36ns None . 2.34ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 16.77ns 11.4969 1.46 36.49ns
error 49.29ns 34.7893 1.42 77.63ns
never 16.75ns 11.5047 1.46 233.07ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 27.91ns 18.6728 1.49 59.67ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 16.78ns 11.4991 1.46 36.81ns
just send variadic 16.76ns 13.5381 1.24 43.66ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 70.86ns 54.2406 1.31 242.22ns
sending of values from observable via map to subscriber 7.37ns None . 1.53ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 17.44ns 12.0455 1.45 125.14ns
merge_with 79.28ns 55.0806 1.44 299.12ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 734.70ns 551.044 1.33 2635.94ns
sending of values from observable via observe_on to subscriber 139.62ns None . 199.92ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 24.44ns 21.1608 1.15 9.40ns
on_error 1.69ns 1.44765 1.16 19.19ns
on_completed 2.70ns 1.44213 1.87 0.67ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 172.25ns 119.829 1.44 178.53ns
get_observable 29.13ns 24.0635 1.21 49.53ns
get_subscriber 62.27ns 48.1738 1.29 13.55ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 47.22ns 35.9917 1.31 10.25ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 111.18ns 81.7549 1.36 309.00ns
sending of values from observable via scan to subscriber 6.04ns None . 2.01ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 1556.53ns 1197.18 1.30 2788.92ns
sending of values from observable via switch_on_next to subscriber 409.81ns None . 676.46ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 663.37ns 492.168 1.35 1067.35ns
sending of values from observable via with_latest_from to subscriber 24.09ns None . 3.02ns

Linux GCC

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 1.01ns 0.388746 2.60 0.34ns
Dynamic observable construction 95.41ns 37.423 2.55 23.66ns
Specific observable construction + as_dynamic 95.22ns 37.5717 2.53 23.39ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 88.97ns 92.2387 0.96 353.54ns
Specific observable lift dynamic observer 119.52ns 139.386 0.86 369.94ns
Dynamic observable lift specific observer 170.45ns 194.843 0.87 409.55ns
Dynamic observable lift dynamic observer 185.35ns 216.355 0.86 385.85ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 47.23ns 56.7131 0.83 344.49ns
Specific observable subscribe dynamic observer 60.55ns 72.9399 0.83 348.04ns
Dynamic observable subscribe specific observer 123.32ns 146.254 0.84 385.64ns
Dynamic observable subscribe dynamic observer 121.34ns 145.02 0.84 360.64ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 145.96ns 58.3095 2.50 345.30ns
Dynamic observable subscribe lambda 371.86ns 140.978 2.64 387.94ns
Specific observable subscribe lambda without subscription 145.93ns 58.4036 2.50 343.93ns
Dynamic observable subscribe lambda without subscription 371.65ns 146.082 2.54 386.66ns
Specific observable subscribe specific subscriber 50.39ns 20.0814 2.51 291.37ns
Dynamic observable subscribe specific subscriber 249.71ns 101.066 2.47 332.84ns
Specific observable subscribe dynamic observer 50.31ns 20.1246 2.50 294.70ns
Dynamic observable subscribe dynamic observer 205.85ns 81.6172 2.52 305.51ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 1.01ns 0.402457 2.50 0.34ns
Dynamic observer construction 94.75ns 37.8069 2.51 21.67ns
Specific observer construction + as_dynamic 94.60ns 38.0471 2.49 21.10ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 1.01ns 0.40243 2.51 0.33ns
Dynamic observer OnNext 6.04ns 2.412 2.51 1.76ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 112.94ns 47.972 2.35 59.34ns
Make copy of subscriber 50.41ns 20.0954 2.51 4.49ns
Transform subsriber to dynamic 44.81ns 54.324 0.82 24.58ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 30.91ns 36.4643 0.85 55.09ns
composite_subscription add 42.38ns 52.6741 0.80 17.70ns
composite_subscription unsubscribe 8.36ns 7.79157 1.07 11.03ns

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 17.31ns 20.9253 0.83 147.97ns
concat_with 83.07ns 104.477 0.80 346.04ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 141.52ns 152.62 0.93 372.71ns
sending of values from observable via distinct_until_changed to subscriber 5.67ns None . 2.35ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 16.73ns 19.1236 0.87 45.69ns
error 49.16ns 57.2823 0.86 81.71ns
never 16.72ns 20.0896 0.83 290.54ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 29.78ns 36.9372 0.81 67.95ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 16.74ns 20.1051 0.83 49.54ns
just send variadic 16.74ns 20.1541 0.83 46.12ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 72.25ns 87.2793 0.83 361.93ns
sending of values from observable via map to subscriber 4.35ns None . 2.68ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 16.97ns 20.7154 0.82 149.35ns
merge_with 83.43ns 104.778 0.80 345.04ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 809.63ns 920.588 0.88 2846.42ns
sending of values from observable via observe_on to subscriber 148.91ns None . 236.92ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 23.42ns 28.9137 0.81 11.14ns
on_error 3.02ns 1.21355 2.49 16.83ns
on_completed 2.68ns 0.790074 3.39 0.67ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 186.93ns 207.693 0.90 177.44ns
get_observable 29.54ns 38.3774 0.77 45.96ns
get_subscriber 60.55ns 73.5163 0.82 14.92ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 44.83ns 62.3365 0.72 22.95ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 130.34ns 139.767 0.93 404.40ns
sending of values from observable via scan to subscriber 4.35ns None . 1.59ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 1654.02ns 2004.1 0.83 4299.75ns
sending of values from observable via switch_on_next to subscriber 430.57ns None . 1078.87ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 755.45ns 853.991 0.88 1388.51ns
sending of values from observable via with_latest_from to subscriber 25.76ns None . 5.05ns

Windows MSVC

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 1.51ns 2.14498 0.70 0.67ns
Dynamic observable construction 81.68ns 68.2687 1.20 125.64ns
Specific observable construction + as_dynamic 82.41ns 68.3955 1.20 125.49ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 137.20ns 137.756 1.00 1224.68ns
Specific observable lift dynamic observer 168.96ns 170.435 0.99 1272.76ns
Dynamic observable lift specific observer 264.50ns 251.081 1.05 1431.89ns
Dynamic observable lift dynamic observer 234.44ns 228.361 1.03 1308.75ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 103.61ns 93.9023 1.10 1187.57ns
Specific observable subscribe dynamic observer 119.42ns 110.964 1.08 1213.77ns
Dynamic observable subscribe specific observer 216.86ns 198.637 1.09 1392.32ns
Dynamic observable subscribe dynamic observer 161.21ns 167.164 0.96 1245.41ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 102.31ns 95.0677 1.08 1173.74ns
Dynamic observable subscribe lambda 216.57ns 204.296 1.06 1358.15ns
Specific observable subscribe lambda without subscription 118.71ns 94.9636 1.25 1176.96ns
Dynamic observable subscribe lambda without subscription 215.37ns 204.5 1.05 1352.00ns
Specific observable subscribe specific subscriber 16.76ns 16.0699 1.04 854.23ns
Dynamic observable subscribe specific subscriber 132.06ns 122.758 1.08 1035.62ns
Specific observable subscribe dynamic observer 16.73ns 16.1526 1.04 893.20ns
Dynamic observable subscribe dynamic observer 64.23ns 68.0994 0.94 925.31ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.67ns 0.420207 1.59 1.51ns
Dynamic observer construction 92.52ns 69.1208 1.34 115.03ns
Specific observer construction + as_dynamic 81.62ns 68.419 1.19 115.29ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.807728 0.83 0.67ns
Dynamic observer OnNext 2.02ns 1.6464 1.23 2.01ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 88.20ns 75.1372 1.17 347.44ns
Make copy of subscriber 16.79ns 16.0772 1.04 36.12ns
Transform subsriber to dynamic 96.64ns 89.6099 1.08 154.83ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 87.44ns 76.2638 1.15 353.75ns
composite_subscription add 65.59ns 65.0767 1.01 63.53ns
composite_subscription unsubscribe 8.39ns 8.07173 1.04 25.60ns

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 35.02ns 41.1813 0.85 674.56ns
concat_with 331.88ns 291.815 1.14 1440.92ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 197.53ns 169.767 1.16 1037.72ns
sending of values from observable via distinct_until_changed to subscriber 4.43ns None . 4.01ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 16.78ns 16.2062 1.04 190.31ns
error 47.46ns 51.9388 0.91 209.10ns
never 16.81ns 16.2395 1.04 847.39ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 92.11ns 74.3642 1.24 265.08ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 19.79ns 23.5607 0.84 192.67ns
just send variadic 20.54ns 24.374 0.84 193.64ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 76.95ns 88.6953 0.87 1045.70ns
sending of values from observable via map to subscriber 6.28ns None . 6.28ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 35.25ns 41.3441 0.85 670.29ns
merge_with 313.78ns 292.761 1.07 1424.73ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 958.84ns 969.8 0.99 5803.60ns
sending of values from observable via observe_on to subscriber 147.09ns None . 872.73ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 20.18ns 22.7239 0.89 32.86ns
on_error 2.84ns 2.2792 1.25 17.71ns
on_completed 2.38ns 2.0382 1.17 0.68ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 294.02ns 285.344 1.03 600.51ns
get_observable 25.84ns 31.0791 0.83 159.97ns
get_subscriber 50.53ns 61.86 0.82 93.81ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 115.43ns 107.87 1.07 95.10ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 169.96ns 163.713 1.04 1245.76ns
sending of values from observable via scan to subscriber 7.25ns None . 9.00ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 3275.00ns 2606.0 1.26 13924.70ns
sending of values from observable via switch_on_next to subscriber 827.25ns None . 3097.56ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1070.52ns 1026.32 1.04 3893.67ns
sending of values from observable via with_latest_from to subscriber 31.45ns None . 6.86ns

Please sign in to comment.