Skip to content

Commit

Permalink
Make lift more readable (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
victimsnino authored Dec 16, 2022
1 parent f972644 commit 9a0c390
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea/
.vs/
.vscode/
.cache/
build/
_build/
cmake/open-cpp-coverage.cmake
Expand Down
18 changes: 17 additions & 1 deletion src/rpp/rpp/operators/filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ IMPLEMENTATION_FILE(filter_tag);
namespace rpp::details
{
template<constraint::decayed_type Type, std::predicate<const Type&> Predicate>
struct filter_impl
struct filter_impl_on_next
{
RPP_NO_UNIQUE_ADDRESS Predicate predicate;

Expand All @@ -35,4 +35,20 @@ struct filter_impl
}
};

template<constraint::decayed_type Type, std::predicate<const Type&> Predicate>
struct filter_impl
{
RPP_NO_UNIQUE_ADDRESS filter_impl_on_next<Type, Predicate> on_next;

template<constraint::subscriber TSub>
auto operator()(TSub&& subscriber) const
{
auto subscription = subscriber.get_subscription();
return create_subscriber_with_state<Type>(std::move(subscription),
on_next,
utils::forwarding_on_error{},
utils::forwarding_on_completed{},
std::forward<TSub>(subscriber));
}
};
} // namespace rpp::details
44 changes: 39 additions & 5 deletions src/rpp/rpp/operators/lift.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@

#pragma once

#include "rpp/observables/specific_observable.hpp"
#include "rpp/subscribers/constraints.hpp"
#include <rpp/defs.hpp> // RPP_NO_UNIQUE_ADDRESS
#include <rpp/operators/details/subscriber_with_state.hpp> // create_subscriber_with_state
#include <rpp/operators/fwd/lift.hpp> // own forwarding
#include <rpp/sources/create.hpp> // create observable
#include <utility>

IMPLEMENTATION_FILE(lift_tag);

Expand All @@ -38,18 +41,25 @@ struct lift_action_by_callbacks
}
};

template<constraint::decayed_type NewType, lift_fn<NewType> OperatorFn>
using subscriber_type_of_list_fn = utils::extract_subscriber_type_t<utils::decayed_invoke_result_t<OperatorFn, dynamic_subscriber<NewType>>>;

/**
* \brief Functor of "lift" operator for on_subscribe overload function.
* \details Each observable has an on_subscribe function and observable is activated (pub-sub channel is established) after on_subscribe is called. The on_subscribe is called when the observable is subscribed by a subscriber
*
* \param _this is the current observable.
* \param op is the functor that provides the "operator()(subscriber_of_new_type) -> subscriber_of_old_type".
*/
template<constraint::decayed_type NewType, lift_fn<NewType> OperatorFn, typename TObs>
struct lift_on_subscribe
template<constraint::decayed_type NewType, lift_fn<NewType> OperatorFn, typename ...ChildLiftArgs>
struct lift_on_subscribe : public lift_on_subscribe<NewType, OperatorFn, lift_on_subscribe<subscriber_type_of_list_fn<NewType, OperatorFn>, ChildLiftArgs...>> {};

template<constraint::decayed_type NewType, lift_fn<NewType> OperatorFn, typename TOnSubscribe>
struct lift_on_subscribe<NewType, OperatorFn, TOnSubscribe>
{
RPP_NO_UNIQUE_ADDRESS TObs _this;
RPP_NO_UNIQUE_ADDRESS OperatorFn op;
using T = subscriber_type_of_list_fn<NewType, OperatorFn>;
RPP_NO_UNIQUE_ADDRESS specific_observable<T, TOnSubscribe> _this;
RPP_NO_UNIQUE_ADDRESS OperatorFn op;

template<constraint::subscriber_of_type<NewType> TSub>
void operator()(TSub&& subscriber) const
Expand All @@ -58,9 +68,33 @@ struct lift_on_subscribe
}
};

template<constraint::decayed_type NewType, lift_fn<NewType> OperatorFn, typename ObservableValue, typename ...ChildLiftArgs>
auto lift_impl_internal(OperatorFn&& op, specific_observable<ObservableValue, lift_on_subscribe<ObservableValue, ChildLiftArgs...>>&& _this)
{
return observable::create<NewType, lift_on_subscribe<NewType, std::decay_t<OperatorFn>, ChildLiftArgs...>>({ std::move(_this), std::forward<OperatorFn>(op) });
}

template<constraint::decayed_type NewType, lift_fn<NewType> OperatorFn, typename ObservableValue, typename ...ChildLiftArgs>
auto lift_impl_internal(OperatorFn&& op, const specific_observable<ObservableValue, lift_on_subscribe<ObservableValue, ChildLiftArgs...>>& _this)
{
return observable::create<NewType, lift_on_subscribe<NewType, std::decay_t<OperatorFn>, ChildLiftArgs...>>({ _this, std::forward<OperatorFn>(op) });
}

template<constraint::decayed_type NewType, lift_fn<NewType> OperatorFn, typename ObservableValue, typename OnSubscribe>
auto lift_impl_internal(OperatorFn&& op, specific_observable<ObservableValue, OnSubscribe>&& _this)
{
return observable::create<NewType, lift_on_subscribe<NewType, std::decay_t<OperatorFn>, OnSubscribe>>({ std::move(_this), std::forward<OperatorFn>(op) });
}

template<constraint::decayed_type NewType, lift_fn<NewType> OperatorFn, typename ObservableValue, typename OnSubscribe>
auto lift_impl_internal(OperatorFn&& op, const specific_observable<ObservableValue, OnSubscribe>& _this)
{
return observable::create<NewType, lift_on_subscribe<NewType, std::decay_t<OperatorFn>, OnSubscribe>>({ _this, std::forward<OperatorFn>(op) });
}

template<constraint::decayed_type NewType, lift_fn<NewType> OperatorFn, typename TObs>
auto lift_impl(OperatorFn&& op, TObs&& _this)
{
return rpp::observable::create<NewType, lift_on_subscribe<NewType, std::decay_t<OperatorFn>, std::decay_t<TObs>>>({ std::forward<TObs>(_this), std::forward<OperatorFn>(op) });
return lift_impl_internal<NewType>(std::forward<OperatorFn>(op), std::forward<TObs>(_this));
}
} // namespace rpp::details
19 changes: 18 additions & 1 deletion src/rpp/rpp/operators/map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ IMPLEMENTATION_FILE(map_tag);
namespace rpp::details
{
template<constraint::decayed_type Type, std::invocable<Type> Callable>
struct map_impl
struct map_impl_on_next
{
RPP_NO_UNIQUE_ADDRESS Callable callable;

Expand All @@ -34,4 +34,21 @@ struct map_impl
subscriber.on_next(callable(utils::as_const(std::forward<TVal>(value))));
}
};

template<constraint::decayed_type Type, std::invocable<Type> Callable>
struct map_impl
{
RPP_NO_UNIQUE_ADDRESS map_impl_on_next<Type, Callable> on_next;

template<constraint::subscriber TSub>
auto operator()(TSub&& subscriber) const
{
auto subscription = subscriber.get_subscription();
return create_subscriber_with_state<Type>(std::move(subscription),
on_next,
utils::forwarding_on_error{},
utils::forwarding_on_completed{},
std::forward<TSub>(subscriber));
}
};
} // namespace rpp::details
19 changes: 18 additions & 1 deletion src/rpp/rpp/operators/take_while.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ IMPLEMENTATION_FILE(take_while_tag);
namespace rpp::details
{
template<constraint::decayed_type Type, std::predicate<const Type&> Predicate>
struct take_while_impl
struct take_while_impl_on_next
{
RPP_NO_UNIQUE_ADDRESS Predicate predicate;

Expand All @@ -35,4 +35,21 @@ struct take_while_impl
subscriber.on_completed();
}
};

template<constraint::decayed_type Type, std::predicate<const Type&> Predicate>
struct take_while_impl
{
RPP_NO_UNIQUE_ADDRESS take_while_impl_on_next<Type, Predicate> on_next;

template<constraint::subscriber TSub>
auto operator()(TSub&& subscriber) const
{
auto subscription = subscriber.get_subscription();
return create_subscriber_with_state<Type>(std::move(subscription),
on_next,
utils::forwarding_on_error{},
utils::forwarding_on_completed{},
std::forward<TSub>(subscriber));
}
};
} // namespace rpp::details

1 comment on commit 9a0c390

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

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.28ns 0.279083 1.00 0.31ns
Dynamic observable construction 68.13ns 73.8976 0.92 107.48ns
Specific observable construction + as_dynamic 82.46ns 68.5415 1.20 113.03ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 131.36ns 147.438 0.89 1127.53ns
Specific observable lift dynamic observer 161.09ns 151.493 1.06 1169.73ns
Dynamic observable lift specific observer 237.85ns 253.516 0.94 1256.44ns
Dynamic observable lift dynamic observer 216.28ns 219.256 0.99 1194.37ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 117.94ns 122.382 0.96 1186.48ns
Specific observable subscribe dynamic observer 135.30ns 122.163 1.11 1161.50ns
Dynamic observable subscribe specific observer 221.40ns 212.326 1.04 1360.26ns
Dynamic observable subscribe dynamic observer 168.27ns 166.414 1.01 1200.77ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 122.94ns 101.03 1.22 1202.26ns
Dynamic observable subscribe lambda 214.90ns 197.685 1.09 1197.74ns
Specific observable subscribe lambda without subscription 105.83ns 133.158 0.79 1134.32ns
Dynamic observable subscribe lambda without subscription 217.81ns 242.397 0.90 1259.49ns
Specific observable subscribe specific subscriber 45.42ns 29.9074 1.52 917.65ns
Dynamic observable subscribe specific subscriber 127.86ns 130.49 0.98 1013.02ns
Specific observable subscribe dynamic observer 31.39ns 31.5167 1.00 825.46ns
Dynamic observable subscribe dynamic observer 72.68ns 71.5468 1.02 860.15ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.28ns 0.281959 0.99 0.31ns
Dynamic observer construction 73.09ns 73.2146 1.00 106.93ns
Specific observer construction + as_dynamic 90.38ns 70.661 1.28 114.17ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.82ns 0.777222 1.05 0.91ns
Dynamic observer OnNext 2.32ns 2.16623 1.07 2.14ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 75.30ns 70.7069 1.06 312.60ns
Make copy of subscriber 16.74ns 12.3975 1.35 30.40ns
Transform subsriber to dynamic 84.94ns 84.7175 1.00 140.07ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 70.01ns 72.7037 0.96 307.45ns
composite_subscription add 56.58ns 81.4857 0.69 101.73ns
composite_subscription unsubscribe 79.99ns 82.1631 0.97 85.04ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1484.79ns 2054.43 0.72 3038.34ns
sending of values from observable via buffer to subscriber 6.45ns 6.75985 0.95 90.53ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 225.89ns 237.423 0.95 1315.54ns
long stateful chain creation + subscribe 528.40ns 583.631 0.91 2626.97ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1345.48ns 1318.25 1.02 .
sending of values from observable via combine_latest to subscriber 30.05ns 22.947 1.31 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 5248.28ns 4716.11 1.11 9215.75ns
concat_with 4354.19ns 4762.19 0.91 10302.80ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 175.51ns 150.721 1.16 1032.01ns
sending of values from observable via distinct_until_changed to subscriber 2.33ns 2.2608 1.03 1.24ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 128.77ns 124.501 1.03 2249.09ns
sending of values from observable via first to subscriber 1.59ns 0.857241 1.86 1.00ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 65.23ns 62.841 1.04 2450.75ns
error 108.43ns 108.751 1.00 3992.32ns
never 32.19ns 32.6048 0.99 966.41ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 806.41ns 608.315 1.33 2262.47ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 2.43ns 2.24457 1.08 380.45ns
re-schedule 10 times 28.73ns 26.0746 1.10 447.39ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 435.85ns 458.377 0.95 2109.34ns
just send variadic 1964.61ns 1704.78 1.15 2364.04ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 247.86ns 267.268 0.93 1444.05ns
sending of values from observable via last to subscriber 2.95ns 2.55683 1.15 1.55ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 67.64ns 66.2129 1.02 926.50ns
sending of values from observable via map to subscriber 1.48ns 1.12053 1.32 1.47ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 4535.56ns 4362.81 1.04 9185.96ns
merge_with 4357.58ns 4937.93 0.88 11074.00ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 1306.09ns 1179.44 1.11 10021.30ns
sending of values from observable via observe_on to subscriber 228.68ns 227.622 1.00 912.44ns

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 610.98ns 612.029 1.00 2906.02ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 23.28ns 20.8012 1.12 27.71ns
on_error 0.57ns 0.562977 1.02 17.04ns
on_completed 0.58ns 1.25702 0.46 3.58ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 392.88ns 345.308 1.14 972.08ns
get_observable 26.48ns 26.8365 0.99 151.97ns
get_subscriber 55.30ns 51.8043 1.07 77.91ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 5670.98ns 5486.64 1.03 9537.91ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 141.24ns 158.574 0.89 1081.09ns
sending of values from observable via scan to subscriber 2.71ns 2.36164 1.15 2.02ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.29ns 1.89514 1.21 .
mutex lock increment 28.09ns 23.1729 1.21 .
spin-lock increment 8.65ns 8.28367 1.04 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 148.87ns 156.737 0.95 1340.24ns
sending of values from observable via skip to subscriber 2.79ns 2.8967 0.96 4.67ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 5044.34ns 4833.84 1.04 10650.20ns
sending of values from observable via switch_on_next to subscriber 929.68ns 973.389 0.96 2920.02ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 188.63ns 209.219 0.90 1946.58ns
sending of values from observable via take to subscriber 2.75ns 2.96074 0.93 5.87ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 349.51ns 314.965 1.11 2176.82ns
sending of values from observable via take_last to subscriber 2.77ns 4.43267 0.62 5.52ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 2402.12ns 2728.19 0.88 4272.40ns
sending of values from observable via take_until to subscriber 10.45ns 8.28437 1.26 2.23ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 9209.88ns 6380.19 1.44 6450.44ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 74.28ns 68.6865 1.08 1186.66ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 48.30ns 36.9354 1.31 577.51ns
re-schedule 10 times 102.41ns 90.2602 1.13 683.75ns
recursively schedule 10 times 2171.52ns 2020.21 1.07 46300.40ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 4943.39ns 5982.8 0.83 8890.65ns
sending of values from observable via window to subscriber 889.38ns 2258.6 0.39 2162.35ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1655.28ns 1678.14 0.99 .
sending of values from observable via with_latest_from to subscriber 23.23ns 24.6697 0.94 .

ci-ubuntu-clang

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.34ns 0.402341 0.83 0.34ns
Dynamic observable construction 18.99ns 19.2669 0.99 30.34ns
Specific observable construction + as_dynamic 17.76ns 18.8629 0.94 30.39ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 50.19ns 52.1915 0.96 331.24ns
Specific observable lift dynamic observer 51.20ns 53.3158 0.96 351.96ns
Dynamic observable lift specific observer 84.11ns 83.879 1.00 388.76ns
Dynamic observable lift dynamic observer 74.79ns 78.7508 0.95 381.16ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 36.55ns 32.9617 1.11 327.03ns
Specific observable subscribe dynamic observer 39.64ns 34.9821 1.13 340.08ns
Dynamic observable subscribe specific observer 70.29ns 64.2534 1.09 368.85ns
Dynamic observable subscribe dynamic observer 59.96ns 59.7015 1.00 346.35ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 36.67ns 33.7997 1.08 322.72ns
Dynamic observable subscribe lambda 66.04ns 60.3632 1.09 364.50ns
Specific observable subscribe lambda without subscription 36.52ns 34.6954 1.05 321.23ns
Dynamic observable subscribe lambda without subscription 64.85ns 62.7979 1.03 363.05ns
Specific observable subscribe specific subscriber 13.73ns 14.4821 0.95 256.62ns
Dynamic observable subscribe specific subscriber 42.55ns 39.5676 1.08 298.47ns
Specific observable subscribe dynamic observer 13.76ns 14.4545 0.95 280.06ns
Dynamic observable subscribe dynamic observer 33.63ns 36.6189 0.92 284.23ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.34ns 0.402104 0.84 0.33ns
Dynamic observer construction 18.32ns 19.2899 0.95 23.69ns
Specific observer construction + as_dynamic 18.78ns 19.1658 0.98 23.63ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.444367 1.51 0.67ns
Dynamic observer OnNext 1.67ns 1.60853 1.04 2.35ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 19.77ns 20.0841 0.98 67.87ns
Make copy of subscriber 6.97ns 10.4554 0.67 8.12ns
Transform subsriber to dynamic 20.04ns 20.5234 0.98 28.23ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 19.48ns 20.8765 0.93 60.39ns
composite_subscription add 18.01ns 21.4116 0.84 95.91ns
composite_subscription unsubscribe 30.28ns 26.9198 1.12 45.28ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 741.44ns 740.951 1.00 1847.59ns
sending of values from observable via buffer to subscriber 6.02ns 4.85254 1.24 25.75ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 102.41ns 133.748 0.77 583.38ns
long stateful chain creation + subscribe 147.18ns 157.429 0.93 1382.19ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 455.39ns 413.675 1.10 .
sending of values from observable via combine_latest to subscriber 9.03ns 8.14505 1.11 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 1848.38ns 1853.41 1.00 3471.95ns
concat_with 1583.28ns 1672.58 0.95 3840.07ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 51.59ns 53.4349 0.97 301.01ns
sending of values from observable via distinct_until_changed to subscriber 2.01ns 2.01166 1.00 1.17ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 62.27ns 67.8545 0.92 695.49ns
sending of values from observable via first to subscriber 1.01ns 1.20567 0.83 1.01ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 36.42ns 37.2591 0.98 681.81ns
error 81.37ns 80.4106 1.01 776.24ns
never 14.46ns 14.3343 1.01 272.12ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 238.08ns 234.54 1.02 711.38ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.34ns 0.788838 1.70 123.08ns
re-schedule 10 times 7.71ns 7.25783 1.06 154.44ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 199.10ns 193.854 1.03 707.10ns
just send variadic 1165.94ns 1177.15 0.99 760.46ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 88.22ns 87.5619 1.01 423.19ns
sending of values from observable via last to subscriber 2.03ns 3.24154 0.63 1.34ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 30.40ns 40.8538 0.74 287.59ns
sending of values from observable via map to subscriber 1.34ns 0.805197 1.66 2.01ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 1750.25ns 1797.59 0.97 3519.73ns
merge_with 1593.88ns 1652.47 0.96 3825.81ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 563.07ns 538.614 1.05 2836.24ns
sending of values from observable via observe_on to subscriber 126.01ns 122.096 1.03 240.45ns

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 232.25ns 224.169 1.04 756.27ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 19.05ns 20.2077 0.94 14.75ns
on_error 0.67ns 0.80731 0.83 16.85ns
on_completed 0.67ns 0.805971 0.84 0.67ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 122.80ns 118.495 1.04 179.80ns
get_observable 7.93ns 10.7418 0.74 50.60ns
get_subscriber 19.67ns 29.9907 0.66 19.78ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 2182.11ns 2097.79 1.04 3278.76ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 46.01ns 47.0161 0.98 367.08ns
sending of values from observable via scan to subscriber 2.01ns 2.00808 1.00 2.34ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.01ns 3.17822 0.63 .
mutex lock increment 8.03ns 6.52479 1.23 .
spin-lock increment 9.06ns 10.4469 0.87 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 45.60ns 47.6384 0.96 528.30ns
sending of values from observable via skip to subscriber 2.01ns 2.46516 0.82 1.79ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 1795.91ns 1825.67 0.98 3499.69ns
sending of values from observable via switch_on_next to subscriber 4627.36ns 3756.07 1.23 803.46ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 81.98ns 82.3892 0.99 573.47ns
sending of values from observable via take to subscriber 2.35ns 2.40977 0.97 2.69ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 112.74ns 109.543 1.03 617.58ns
sending of values from observable via take_last to subscriber 2.36ns 3.25298 0.72 4.18ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 879.22ns 912.758 0.96 1400.21ns
sending of values from observable via take_until to subscriber 8.80ns 10.4521 0.84 2.34ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 796.44ns 792.778 1.00 17500.00ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 41.39ns 43.0236 0.96 16176.60ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 8.38ns 7.67209 1.09 181.78ns
re-schedule 10 times 27.88ns 30.0404 0.93 216.21ns
recursively schedule 10 times 1417.11ns 1300.04 1.09 8105.33ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 1594.82ns 1634.22 0.98 3297.71ns
sending of values from observable via window to subscriber 264.06ns 272.907 0.97 413.10ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 528.03ns 493.461 1.07 .
sending of values from observable via with_latest_from to subscriber 8.48ns 7.64245 1.11 .

ci-ubuntu-gcc

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.41ns 0.33509 1.24 0.39ns
Dynamic observable construction 40.57ns 32.5584 1.25 62.01ns
Specific observable construction + as_dynamic 37.20ns 32.5985 1.14 79.89ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 126.64ns 99.4369 1.27 858.92ns
Specific observable lift dynamic observer 160.35ns 127.693 1.26 983.83ns
Dynamic observable lift specific observer 224.64ns 184.079 1.22 1399.22ns
Dynamic observable lift dynamic observer 256.25ns 196.535 1.30 1044.97ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 72.32ns 61.7041 1.17 862.71ns
Specific observable subscribe dynamic observer 96.40ns 80.4182 1.20 941.06ns
Dynamic observable subscribe specific observer 162.54ns 132.914 1.22 1037.58ns
Dynamic observable subscribe dynamic observer 173.26ns 128.634 1.35 825.73ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 71.08ns 61.7678 1.15 831.85ns
Dynamic observable subscribe lambda 159.80ns 132.962 1.20 983.65ns
Specific observable subscribe lambda without subscription 71.83ns 61.7225 1.16 837.72ns
Dynamic observable subscribe lambda without subscription 159.06ns 133.365 1.19 1006.74ns
Specific observable subscribe specific subscriber 35.48ns 30.4293 1.17 724.14ns
Dynamic observable subscribe specific subscriber 126.17ns 99.2984 1.27 764.78ns
Specific observable subscribe dynamic observer 39.25ns 30.4577 1.29 815.98ns
Dynamic observable subscribe dynamic observer 164.98ns 85.1826 1.94 842.89ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.40ns 0.334541 1.20 0.35ns
Dynamic observer construction 37.96ns 32.5753 1.17 51.79ns
Specific observer construction + as_dynamic 39.00ns 32.5504 1.20 58.23ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.44ns 0.335741 1.30 0.41ns
Dynamic observer OnNext 2.49ns 1.67441 1.49 2.48ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 41.88ns 35.5295 1.18 160.24ns
Make copy of subscriber 22.03ns 16.7582 1.31 31.99ns
Transform subsriber to dynamic 54.76ns 46.4423 1.18 87.31ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 46.53ns 35.5633 1.31 173.09ns
composite_subscription add 57.42ns 47.3263 1.21 126.73ns
composite_subscription unsubscribe 56.66ns 43.4265 1.30 44.58ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1143.14ns 950.735 1.20 3633.35ns
sending of values from observable via buffer to subscriber 7.43ns 6.24771 1.19 34.13ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 359.07ns 288.476 1.24 1841.48ns
long stateful chain creation + subscribe 545.72ns 432.862 1.26 6860.34ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1114.51ns 862.015 1.29 .
sending of values from observable via combine_latest to subscriber 10.60ns 9.24584 1.15 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 3835.42ns 2939.5 1.30 10384.00ns
concat_with 3188.72ns 2745.77 1.16 11000.30ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 142.88ns 120.97 1.18 903.25ns
sending of values from observable via distinct_until_changed to subscriber 3.23ns 2.69449 1.20 1.44ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 170.50ns 138.72 1.23 2016.32ns
sending of values from observable via first to subscriber 0.77ns 1.36738 0.57 0.61ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 222.82ns 67.7526 3.29 2076.14ns
error 148.00ns 117.998 1.25 3554.62ns
never 40.62ns 32.3405 1.26 815.54ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 433.11ns 331.45 1.31 2206.54ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.12ns 1.67552 0.67 379.62ns
re-schedule 10 times 22.66ns 22.7665 1.00 396.41ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 384.35ns 299.045 1.29 2327.14ns
just send variadic 1658.68ns 1407.89 1.18 2252.08ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 216.48ns 176.932 1.22 1208.66ns
sending of values from observable via last to subscriber 3.53ns 2.34096 1.51 1.53ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 98.37ns 84.0151 1.17 804.89ns
sending of values from observable via map to subscriber 0.92ns 0.754903 1.22 1.79ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 4110.52ns 2869.77 1.43 12533.00ns
merge_with 3457.62ns 2729.23 1.27 11466.70ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 982.79ns 809.292 1.21 5533.74ns
sending of values from observable via observe_on to subscriber 171.40ns 159.402 1.08 702.52ns

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 591.43ns 440.506 1.34 1728.19ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 29.19ns 22.3955 1.30 18.99ns
on_error 0.80ns 1.01104 0.79 20.47ns
on_completed 0.77ns 0.67317 1.14 0.83ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 281.32ns 213.11 1.32 453.76ns
get_observable 36.83ns 29.4729 1.25 109.65ns
get_subscriber 62.97ns 57.3069 1.10 107.57ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 5000.31ns 4182.44 1.20 9464.04ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 145.08ns 118.849 1.22 1064.93ns
sending of values from observable via scan to subscriber 3.15ns 1.69004 1.86 2.05ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.59ns 2.01109 1.29 .
mutex lock increment 9.54ns 8.16454 1.17 .
spin-lock increment 14.01ns 9.03669 1.55 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 129.95ns 117.195 1.11 1470.19ns
sending of values from observable via skip to subscriber 4.01ns 2.36575 1.69 2.26ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 3837.13ns 3129.56 1.23 13314.70ns
sending of values from observable via switch_on_next to subscriber 1420.06ns 793.124 1.79 3492.57ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 228.15ns 171.754 1.33 1674.75ns
sending of values from observable via take to subscriber 4.73ns 3.97237 1.19 4.50ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 262.03ns 208.623 1.26 1904.80ns
sending of values from observable via take_last to subscriber 4.21ns 3.1001 1.36 7.63ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1895.66ns 1590.87 1.19 4388.52ns
sending of values from observable via take_until to subscriber 13.66ns 9.02217 1.51 2.27ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1338.97ns 1116.98 1.20 21193.10ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 74.03ns 60.7799 1.22 4587.02ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 23.12ns 22.6782 1.02 465.34ns
re-schedule 10 times 48.21ns 51.2415 0.94 476.02ns
recursively schedule 10 times 1665.16ns 1439.59 1.16 26796.20ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 3304.47ns 2730.5 1.21 7707.24ns
sending of values from observable via window to subscriber 649.14ns 549.88 1.18 1167.72ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1233.69ns 1059.98 1.16 .
sending of values from observable via with_latest_from to subscriber 11.49ns 9.16134 1.25 .

ci-windows

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 1.81ns 1.44461 1.25 0.79ns
Dynamic observable construction 97.42ns 51.1272 1.91 136.82ns
Specific observable construction + as_dynamic 98.09ns 52.561 1.87 142.80ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 174.96ns 99.7158 1.75 1467.52ns
Specific observable lift dynamic observer 214.68ns 120.575 1.78 1502.48ns
Dynamic observable lift specific observer 332.52ns 193.882 1.72 1703.67ns
Dynamic observable lift dynamic observer 289.59ns 168.133 1.72 1261.67ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 132.90ns 72.3136 1.84 1345.32ns
Specific observable subscribe dynamic observer 156.50ns 82.6589 1.89 1453.09ns
Dynamic observable subscribe specific observer 273.55ns 149.759 1.83 1548.35ns
Dynamic observable subscribe dynamic observer 215.07ns 120.574 1.78 1485.50ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 134.53ns 70.0476 1.92 1335.87ns
Dynamic observable subscribe lambda 265.31ns 149.636 1.77 1583.35ns
Specific observable subscribe lambda without subscription 134.70ns 70.0627 1.92 1413.36ns
Dynamic observable subscribe lambda without subscription 364.65ns 148.058 2.46 1628.00ns
Specific observable subscribe specific subscriber 36.59ns 19.1175 1.91 1019.32ns
Dynamic observable subscribe specific subscriber 177.75ns 95.773 1.86 1216.46ns
Specific observable subscribe dynamic observer 36.57ns 19.0742 1.92 1064.10ns
Dynamic observable subscribe dynamic observer 94.45ns 55.9748 1.69 1094.83ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 1.81ns 1.43214 1.27 3.23ns
Dynamic observer construction 99.63ns 52.3176 1.90 127.54ns
Specific observer construction + as_dynamic 99.99ns 51.532 1.94 136.66ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.80ns 0.321716 2.50 0.78ns
Dynamic observer OnNext 2.41ns 1.16547 2.07 2.06ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 101.39ns 51.9733 1.95 422.44ns
Make copy of subscriber 20.07ns 11.4657 1.75 37.31ns
Transform subsriber to dynamic 117.55ns 80.6105 1.46 180.31ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 125.45ns 51.414 2.44 360.68ns
composite_subscription add 82.93ns 48.7535 1.70 182.23ns
composite_subscription unsubscribe 75.00ns 45.7698 1.64 146.21ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1321.95ns 735.25 1.80 5449.50ns
sending of values from observable via buffer to subscriber 8.83ns 4.90253 1.80 111.73ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 310.58ns 212.308 1.46 2089.93ns
long stateful chain creation + subscribe 853.03ns 457.027 1.87 4116.25ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1972.00ns 1131.87 1.74 .
sending of values from observable via combine_latest to subscriber 42.70ns 25.6098 1.67 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 4767.57ns 2879.29 1.66 12754.30ns
concat_with 5113.50ns 3003.67 1.70 15158.00ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 221.14ns 126.128 1.75 4021.35ns
sending of values from observable via distinct_until_changed to subscriber 7.18ns 2.32849 3.08 5.04ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 224.47ns 100.396 2.24 3077.10ns
sending of values from observable via first to subscriber 3.35ns 1.76196 1.90 2.10ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 74.06ns 45.3523 1.63 2895.45ns
error 130.04ns 87.9655 1.48 2847.50ns
never 36.16ns 20.5743 1.76 1029.12ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 618.16ns 365.178 1.69 2869.40ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 2.01ns 1.00383 2.00 491.08ns
re-schedule 10 times 196.94ns 93.1937 2.11 554.00ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 445.44ns 270.8 1.64 2911.00ns
just send variadic 1584.95ns 867.5 1.83 2962.50ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 266.28ns 156.854 1.70 1713.94ns
sending of values from observable via last to subscriber 3.93ns 2.21789 1.77 4.00ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 101.49ns 64.6752 1.57 1765.81ns
sending of values from observable via map to subscriber 4.84ns 2.52848 1.91 8.77ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 4799.29ns 2840.29 1.69 13047.70ns
merge_with 4930.43ns 2953.0 1.67 16086.70ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 1479.10ns 871.0 1.70 6877.20ns
sending of values from observable via observe_on to subscriber 231.02ns 137.58 1.68 1091.27ns

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 724.21ns 441.333 1.64 2196.69ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 23.23ns 16.1774 1.44 39.01ns
on_error 3.01ns 1.77053 1.70 22.16ns
on_completed 2.63ns 2.12282 1.24 0.82ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 412.15ns 243.581 1.69 719.94ns
get_observable 31.44ns 22.1023 1.42 195.98ns
get_subscriber 59.29ns 44.1172 1.34 112.47ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 7205.00ns 4283.8 1.68 19307.70ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 218.84ns 121.101 1.81 1497.50ns
sending of values from observable via scan to subscriber 7.66ns 3.82655 2.00 10.32ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.19ns 2.28296 0.96 .
mutex lock increment 29.96ns 17.1879 1.74 .
spin-lock increment 10.94ns 7.44731 1.47 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 211.71ns 129.489 1.63 1855.47ns
sending of values from observable via skip to subscriber 3.94ns 2.35524 1.67 4.16ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 5726.00ns 3353.5 1.71 14279.00ns
sending of values from observable via switch_on_next to subscriber 1316.95ns 799.75 1.65 3782.11ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 1211.72ns 164.624 7.36 2543.08ns
sending of values from observable via take to subscriber 7.30ns 4.37691 1.67 7.77ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 364.46ns 224.264 1.63 2900.45ns
sending of values from observable via take_last to subscriber 5.01ns 2.91696 1.72 25.09ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 2757.75ns 1618.36 1.70 6177.40ns
sending of values from observable via take_until to subscriber 13.37ns 8.77452 1.52 6.59ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1958.71ns 1169.0 1.68 6547.50ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 61.71ns 41.5404 1.49 1677.33ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 21.70ns 13.7758 1.58 734.30ns
re-schedule 10 times 141.43ns 103.854 1.36 768.48ns
recursively schedule 10 times 3157.40ns 1781.64 1.77 22947.50ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 4373.43ns 2615.0 1.67 11452.30ns
sending of values from observable via window to subscriber 1517.71ns 591.419 2.57 1946.53ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 2415.17ns 1340.0 1.80 .
sending of values from observable via with_latest_from to subscriber 56.33ns 19.5863 2.88 .

Please sign in to comment.