Skip to content

Commit

Permalink
Improve doxygen docs and make it much more detailed No1 (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
victimsnino authored Dec 25, 2022
1 parent 1cea027 commit 4d52c08
Show file tree
Hide file tree
Showing 21 changed files with 578 additions and 288 deletions.
17 changes: 8 additions & 9 deletions src/rpp/rpp/operators/first.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ using first_on_next = take_on_next;

struct first_on_completed
{
void operator()(const constraint::subscriber auto& subscriber, const first_state& state) const
void operator()(const constraint::subscriber auto& subscriber, const first_state&) const
{
if (state.count != 0)
subscriber.on_error(std::make_exception_ptr(utils::not_enough_emissions{"first() operator expects at least one emission from observable before completion"}));
subscriber.on_error(std::make_exception_ptr(utils::not_enough_emissions{"first() operator expects at least one emission from observable before completion"}));
}
};

Expand All @@ -50,12 +49,12 @@ struct first_impl
auto subscription = subscriber.get_subscription();

// dynamic_state there to make shared_ptr for observer instead of making shared_ptr for state
return create_subscriber_with_state<Type>(std::move(subscription),
first_on_next{},
utils::forwarding_on_error{},
first_on_completed{},
std::forward<TSub>(subscriber),
first_state{});
return create_subscriber_with_dynamic_state<Type>(std::move(subscription),
first_on_next{},
utils::forwarding_on_error{},
first_on_completed{},
std::forward<TSub>(subscriber),
first_state{});
}
};
} // namespace rpp::details
14 changes: 12 additions & 2 deletions src/rpp/rpp/operators/fwd/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, buffer_tag>
{
/**
* \brief periodically gather items emitted by an Observable into bundles and emit these bundles rather than emitting
* \brief Periodically gather emissions emitted by an original Observable into bundles and emit these bundles rather than emitting
* the items one at a time
*
* \marble buffer
Expand All @@ -41,14 +41,24 @@ struct member_overload<Type, SpecificObservable, buffer_tag>
operator "buffer(2)" : +---{1,2}-{3}-|
}
*
* \details the resulting bundle is std::vector. Actually it is similar to `window` but it emits vectors instead of observables.
* \details The resulting bundle is `std::vector<Type>` of requested size. Actually it is similar to `window()` operator, but it emits vectors instead of observables.
*
* \param count number of items being bundled.
* \return new specific_observable with the buffer operator as most recent operator.
* \warning #include <rpp/operators/buffer.hpp>
*
* \par Example:
* \snippet buffer.cpp buffer
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store `std::vector<Type>` of requested size.
* - <b>OnNext</b>
* - Accumulates emissions inside current bundle and emits this bundle when requested cound reached and starts new bundle.
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
* - Emits current active bundle (if any) and just forwards on_completed
*
* \ingroup transforming_operators
* \see https://reactivex.io/documentation/operators/buffer.html
Expand Down
111 changes: 69 additions & 42 deletions src/rpp/rpp/operators/fwd/combine_latest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,41 @@ template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, combine_latest_tag>
{

/**
* \brief Combines latest emissions from current observable and other observables when any of them emits.
* \warning According to observable contract (https://reactivex.io/documentation/contract.html) emissions from any observable should be serialized, so, resulting observable uses mutex to satisfy this requirement
*
* \marble combine_latest_custom_combiner
{
source observable : +---1 -- -- -2 -- -3 -|
source other_observable : +-5-- -6 -7 -- -8 - -|
operator "combine_latest: x,y =>std::pair{x,y}" : +---{1,5}-{1,6}-{1,7}-{2,7}-{2,8}-{3,8}-|
}
*
* \param combiner combines emissions from all the observables using custom composition.
* \param observables are observables whose emissions would be combined with the current observable's emissions
* \return new specific_observable with the combine_latest operator as most recent operator.
* \warning #include <rpp/operators/combine_latest.hpp>
*
* \par Examples
* \snippet combine_latest.cpp combine_latest custom combiner
*
* \ingroup combining_operators
* \see https://reactivex.io/documentation/operators/combinelatest.html
*/
/**
* \brief Combines latest emissions from original observable and other observables when any of them emits.
* \warning According to observable contract (https://reactivex.io/documentation/contract.html) emissions from any observable should be serialized, so, resulting observable uses `std::mutex` to satisfy this requirement
*
* \marble combine_latest_custom_combiner
{
source observable : +---1 -- -- -2 -- -3 -|
source other_observable : +-5-- -6 -7 -- -8 - -|
operator "combine_latest: x,y =>std::pair{x,y}" : +---{1,5}-{1,6}-{1,7}-{2,7}-{2,8}-{3,8}-|
}
* \details Actually this operator subscribes on all of theses observables and emits new combined value when any of them emits new emission (and each observable emit values at least one to be able to provide combined value)
*
* \param combiner combines emissions from all the observables using custom composition.
* \param observables are observables whose emissions would be combined with the current observable's emissions
* \return new specific_observable with the combine_latest operator as most recent operator.
* \warning #include <rpp/operators/combine_latest.hpp>
*
* \par Examples
* \snippet combine_latest.cpp combine_latest custom combiner
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store last emissions.
* - Wraps subscriber with serialization logic to be sure callbacks called serialized
* - <b>OnNext</b>
* - Keeps last emission from each observable
* - Applies combiner function and emits result if there is last emissions for each observable
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
* - Just forwards original on_completed
*
* \ingroup combining_operators
* \see https://reactivex.io/documentation/operators/combinelatest.html
*/
template<constraint::observable ...TOtherObservable, std::invocable<Type, utils::extract_observable_type_t<TOtherObservable>...> TCombiner>
auto combine_latest(TCombiner&& combiner, TOtherObservable&&...observables) const& requires is_header_included<combine_latest_tag, TOtherObservable...>
{
Expand All @@ -78,26 +91,40 @@ struct member_overload<Type, SpecificObservable, combine_latest_tag>
});
}

/**
* \brief Combines latest emissions from current observable and other observables when any of them emits. The combining result is std::tuple<...>.
*
* \marble combine_latest
{
source observable : +---1 -- -- -2 -- -3 -|
source other_observable : +-5-- -6 -7 -- -8 - -|
operator "combine_latest:tuple" : +---{1,5}-{1,6}-{1,7}-{2,7}-{2,8}-{3,8}-|
}
*
* \param observables are observables whose emissions would be combined with the current observable's emissions
* \return new specific_observable with the combine_latest operator as most recent operator.
* \warning #include <rpp/operators/combine_latest.hpp>
*
* \par Examples
* \snippet combine_latest.cpp combine_latest custom combiner
*
* \ingroup combining_operators
* \see https://reactivex.io/documentation/operators/combinelatest.html
*/
/**
* \brief Combines latest emissions from current observable and other observables when any of them emits. The combining result is std::tuple<...>.
*
* \marble combine_latest
{
source observable : +---1 -- -- -2 -- -3 -|
source other_observable : +-5-- -6 -7 -- -8 - -|
operator "combine_latest:tuple" : +---{1,5}-{1,6}-{1,7}-{2,7}-{2,8}-{3,8}-|
}
*
* \details Actually this operator subscribes on all of theses observables and emits `std::tuple` of last emissions when any of them emits new emission (and each observable emit values at least one to be able to provide combined value)
*
* \param observables are observables whose emissions would be combined with the current observable's emissions
* \return new specific_observable with the combine_latest operator as most recent operator.
* \warning #include <rpp/operators/combine_latest.hpp>
*
* \par Examples
* \snippet combine_latest.cpp combine_latest custom combiner
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store last emissions.
* - Wraps subscriber with serialization logic to be sure callbacks called serialized
* - <b>OnNext</b>
* - Keeps last emission from each observable
* - Emits `std::tuple` of last emissions if there is last emissions for each observable
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
* - Just forwards original on_completed
*
* \ingroup combining_operators
* \see https://reactivex.io/documentation/operators/combinelatest.html
*/
template<constraint::observable ...TOtherObservable>
auto combine_latest(TOtherObservable&&...observables) const& requires is_header_included<combine_latest_tag, TOtherObservable...>
{
Expand Down
76 changes: 53 additions & 23 deletions src/rpp/rpp/operators/fwd/concat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,43 @@ auto concat_with_impl(TObservables&&... observables);
template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, concat_tag>
{
/**
* \brief Converts observable of observables of items into observable of items via merging emissions but without overlapping (current observable completes THEN next started to emit its values)
*
* \marble concat
{
source observable :
{
+--1-2-3-|
.....+4--6-|
}
operator "concat" : +--1-2-3-4--6-|
/**
* \brief Converts observable of observables of items into observable of items via merging emissions but without overlapping (current observable completes THEN next started to emit its values)
*
* \marble concat
{
source observable :
{
+--1-2-3-|
.....+4--6-|
}
*
* \return new specific_observable with the concat operator as most recent operator.
* \warning #include <rpp/operators/concat.hpp>
*
* \par Example
* \snippet concat.cpp concat
*
* \ingroup aggregate_operators
* \see https://reactivex.io/documentation/operators/concat.html
*/
operator "concat" : +--1-2-3-4--6-|
}
*
* \details Actually it subscribes on first observable from emissions. When first observable completes, then it subscribes on second observable from emissions and etc...
*
* \return new specific_observable with the concat operator as most recent operator.
* \warning #include <rpp/operators/concat.hpp>
*
* \par Example
* \snippet concat.cpp concat
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store observables (== emissions) and some internal variables
* - Wraps subscriber with serialization logic to be sure callbacks called serialized
* - <b>OnNext for original observable</b>
* - If no any active observable, then subscribes on new obtained observable, else place it in queue
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted from original observable</b>
* - Just forwards original on_completed if no any active observable (else we need to processa all observables from queue and they would emit on_completed for subscriber)
* - <b>OnCompleted from inner observable</b>
* - Subscribe on next observable from queue (if any)
*
* \ingroup aggregate_operators
* \see https://reactivex.io/documentation/operators/concat.html
*/
template<typename ...Args>
auto concat() const& requires (is_header_included<concat_tag, Args...>&& rpp::constraint::observable<Type>)
{
Expand All @@ -70,16 +85,31 @@ struct member_overload<Type, SpecificObservable, concat_tag>
* \marble concat_with
{
source original_observable: +--1-2-3-|
source second: +-----4--6-|
operator "concat_with" : +--1-2-3------4--6-|
source second: +-4--6-|
operator "concat_with" : +--1-2-3--4--6-|
}
*
* \details Actually this operator subscribes on original observable. When original observable completes, then it subscribes on first observable from arguments and etc...
*
* \return new specific_observable with the concat operator as most recent operator.
* \warning #include <rpp/operators/concat.hpp>
*
* \par Example
* \snippet concat.cpp concat_with
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store observables (== emissions) and some internal variables
* - Wraps subscriber with serialization logic to be sure callbacks called serialized
* - <b>OnNext</b>
* - Just forwards on_next
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted from original observable</b>
* - Just forwards original on_completed if no any active observable (else we need to processa all observables from queue and they would emit on_completed for subscriber)
* - <b>OnCompleted from inner observable</b>
* - Subscribe on next observable from queue (if any)
*
* \ingroup aggregate_operators
* \see https://reactivex.io/documentation/operators/concat.html
*/
Expand Down
55 changes: 36 additions & 19 deletions src/rpp/rpp/operators/fwd/debounce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,42 @@ struct debounce_impl;
template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, debounce_tag>
{
/**
* \brief Only emit emission if specified period of time has passed without any other emission. On each new emission timer reset.
*
* \marble debounce
{
source observable : +--1-2-----3---|
operator "debounce(4)" : +--------2-----3|
}
* \param period is duration of time should be passed since emission from original observable without any new emissions to emit this emission.
* \param scheduler is scheduler used to run timer for debounce
* \return new specific_observable with the debounce operator as most recent operator.
* \warning #include <rpp/operators/debounce.hpp>
*
* \par Example
* \snippet debounce.cpp debounce
*
* \ingroup utility_operators
* \see https://reactivex.io/documentation/operators/debounce.html
*/
/**
* \brief Only emit emission if specified period of time has passed without any other emission. On each new emission timer reset.
*
* \marble debounce
{
source observable : +--1-2-----3---|
operator "debounce(4)" : +--------2-----3|
}
*
* \details Actually this operator resets time of last emission, schedules action to send this emission after specified period if no any new emissions till this moment.
*
* \param period is duration of time should be passed since emission from original observable without any new emissions to emit this emission.
* \param scheduler is scheduler used to run timer for debounce
* \return new specific_observable with the debounce operator as most recent operator.
* \warning #include <rpp/operators/debounce.hpp>
*
* \par Example
* \snippet debounce.cpp debounce
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store last emission and time.
* - Wraps subscriber with serialization logic to prevent race-conditions
* - <b>OnNext</b>
* - Saves time when emission happened
* - Saves emission
* - Schedule action to send this emission with check if no any new emissions
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
* - Just forwards original on_completed
* - Immediately send current active emission if any
*
* \ingroup utility_operators
* \see https://reactivex.io/documentation/operators/debounce.html
*/
template<schedulers::constraint::scheduler TScheduler>
auto debounce(schedulers::duration period,const TScheduler& scheduler = TScheduler{}) const & requires is_header_included<debounce_tag, TScheduler>
{
Expand Down
Loading

1 comment on commit 4d52c08

@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.27ns 0.282249 0.97 0.27ns
Dynamic observable construction 68.83ns 74.4764 0.92 100.80ns
Specific observable construction + as_dynamic 67.37ns 69.5801 0.97 99.89ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 137.75ns 161.195 0.85 1041.22ns
Specific observable lift dynamic observer 155.15ns 161.521 0.96 1121.17ns
Dynamic observable lift specific observer 237.66ns 238.145 1.00 1170.24ns
Dynamic observable lift dynamic observer 199.04ns 208.995 0.95 1172.22ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 133.52ns 111.353 1.20 1005.36ns
Specific observable subscribe dynamic observer 116.65ns 141.302 0.83 1081.19ns
Dynamic observable subscribe specific observer 199.06ns 635.026 0.31 1185.44ns
Dynamic observable subscribe dynamic observer 272.05ns 164.1 1.66 1116.66ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 131.18ns 355.037 0.37 1004.37ns
Dynamic observable subscribe lambda 216.61ns 251.3 0.86 1135.97ns
Specific observable subscribe lambda without subscription 103.75ns 123.032 0.84 1082.85ns
Dynamic observable subscribe lambda without subscription 197.34ns 203.06 0.97 1164.30ns
Specific observable subscribe specific subscriber 28.46ns 29.9847 0.95 751.21ns
Dynamic observable subscribe specific subscriber 127.30ns 140.371 0.91 899.03ns
Specific observable subscribe dynamic observer 29.73ns 31.2702 0.95 767.77ns
Dynamic observable subscribe dynamic observer 69.25ns 71.7425 0.97 818.83ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.27ns 0.280557 0.97 0.26ns
Dynamic observer construction 69.74ns 1010.53 0.07 95.84ns
Specific observer construction + as_dynamic 70.61ns 72.1017 0.98 96.42ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.75ns 0.78895 0.95 0.76ns
Dynamic observer OnNext 1.98ns 2.49368 0.79 2.02ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 76.14ns 94.154 0.81 424.89ns
Make copy of subscriber 11.91ns 13.5649 0.88 26.72ns
Transform subsriber to dynamic 85.54ns 198.985 0.43 128.74ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 72.56ns 79.1606 0.92 287.94ns
composite_subscription add 55.02ns 184.167 0.30 100.00ns
composite_subscription unsubscribe 70.74ns 81.6995 0.87 74.98ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1290.46ns 1380.22 0.93 2974.92ns
sending of values from observable via buffer to subscriber 5.50ns 5.81758 0.95 82.34ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 207.85ns 219.85 0.95 1271.82ns
long stateful chain creation + subscribe 502.27ns 524.842 0.96 2562.88ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1228.68ns 1781.2 0.69 .
sending of values from observable via combine_latest to subscriber 22.26ns 23.2213 0.96 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 3932.92ns 4342.49 0.91 9040.98ns
concat_with 4016.18ns 4174.02 0.96 10026.30ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 163.27ns 148.199 1.10 883.99ns
sending of values from observable via distinct_until_changed to subscriber 2.11ns 2.24888 0.94 1.07ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 180.03ns 127.793 1.41 2040.87ns
sending of values from observable via first to subscriber 0.54ns 0.839644 0.65 0.95ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 71.32ns 65.0052 1.10 2056.86ns
error 106.84ns 111.637 0.96 2210.36ns
never 31.00ns 32.6538 0.95 913.40ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 582.31ns 602.197 0.97 2211.24ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 2.14ns 2.23081 0.96 371.27ns
re-schedule 10 times 24.12ns 27.0266 0.89 396.31ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 418.60ns 616.408 0.68 2098.96ns
just send variadic 1767.44ns 1892.03 0.93 2154.03ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 277.92ns 214.962 1.29 1186.64ns
sending of values from observable via last to subscriber 4.19ns 2.50481 1.67 1.24ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 63.39ns 106.897 0.59 826.98ns
sending of values from observable via map to subscriber 1.08ns 1.11581 0.97 1.33ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 3924.08ns 4339.58 0.90 8870.14ns
merge_with 3811.26ns 6044.25 0.63 9817.87ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 1128.93ns 1202.88 0.94 9354.20ns
sending of values from observable via observe_on to subscriber 200.25ns 218.406 0.92 786.62ns

on_error_resume_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_error_resume_next construction from observable via dot + subscribe 723.95ns 576.102 1.26 1400.51ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 20.29ns 20.6815 0.98 26.37ns
on_error 0.53ns 0.571689 0.93 16.49ns
on_completed 0.54ns 0.570408 0.95 2.12ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 310.05ns 362.611 0.86 505.65ns
get_observable 26.14ns 26.4678 0.99 147.21ns
get_subscriber 50.78ns 51.8754 0.98 75.04ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 5292.06ns 6048.15 0.87 8928.06ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 136.17ns 148.962 0.91 1070.82ns
sending of values from observable via scan to subscriber 2.18ns 2.49973 0.87 1.87ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 1.73ns 1.82107 0.95 .
mutex lock increment 21.57ns 22.9284 0.94 .
spin-lock increment 7.84ns 8.23563 0.95 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 147.29ns 150.183 0.98 1295.26ns
sending of values from observable via skip to subscriber 2.04ns 2.88259 0.71 1.75ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 4433.34ns 4719.91 0.94 9450.31ns
sending of values from observable via switch_on_next to subscriber 865.98ns 963.191 0.90 2456.88ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 182.50ns 262.814 0.69 1761.09ns
sending of values from observable via take to subscriber 2.83ns 2.71545 1.04 5.45ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 270.49ns 355.318 0.76 2026.98ns
sending of values from observable via take_last to subscriber 2.69ns 2.72643 0.99 4.88ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 2276.06ns 2339.24 0.97 4202.89ns
sending of values from observable via take_until to subscriber 7.67ns 7.80139 0.98 2.24ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 5815.67ns 6286.12 0.93 4209.25ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 66.39ns 69.9051 0.95 900.34ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 27.82ns 29.9274 0.93 586.92ns
re-schedule 10 times 96.88ns 142.61 0.68 600.42ns
recursively schedule 10 times 1944.65ns 1985.53 0.98 15237.90ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 3779.06ns 4205.06 0.90 8087.45ns
sending of values from observable via window to subscriber 800.28ns 1149.46 0.70 1358.63ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1568.52ns 1579.49 0.99 .
sending of values from observable via with_latest_from to subscriber 24.59ns 22.8915 1.07 .

ci-ubuntu-clang

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.33ns 0.40297 0.83 0.34ns
Dynamic observable construction 18.37ns 19.2765 0.95 30.42ns
Specific observable construction + as_dynamic 18.02ns 18.8868 0.95 30.38ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 50.40ns 51.4931 0.98 323.08ns
Specific observable lift dynamic observer 51.06ns 53.1799 0.96 346.01ns
Dynamic observable lift specific observer 84.16ns 84.3488 1.00 374.71ns
Dynamic observable lift dynamic observer 74.97ns 79.1791 0.95 362.31ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 36.57ns 32.7047 1.12 333.78ns
Specific observable subscribe dynamic observer 37.30ns 34.6166 1.08 341.87ns
Dynamic observable subscribe specific observer 70.31ns 67.1302 1.05 364.40ns
Dynamic observable subscribe dynamic observer 59.85ns 60.9164 0.98 348.73ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 36.63ns 33.8263 1.08 338.03ns
Dynamic observable subscribe lambda 65.94ns 59.8595 1.10 362.10ns
Specific observable subscribe lambda without subscription 36.53ns 33.854 1.08 339.48ns
Dynamic observable subscribe lambda without subscription 64.75ns 58.615 1.10 362.64ns
Specific observable subscribe specific subscriber 13.73ns 14.4635 0.95 256.99ns
Dynamic observable subscribe specific subscriber 42.80ns 40.9321 1.05 297.60ns
Specific observable subscribe dynamic observer 13.78ns 14.4433 0.95 275.44ns
Dynamic observable subscribe dynamic observer 33.64ns 37.6007 0.89 283.33ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.33ns 0.402297 0.83 0.34ns
Dynamic observer construction 18.09ns 18.9478 0.95 23.67ns
Specific observer construction + as_dynamic 19.14ns 18.8557 1.01 23.69ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.44182 1.51 0.67ns
Dynamic observer OnNext 1.68ns 1.60836 1.04 2.34ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 20.05ns 20.8142 0.96 71.13ns
Make copy of subscriber 6.96ns 10.434 0.67 8.13ns
Transform subsriber to dynamic 19.76ns 20.695 0.95 28.14ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 19.42ns 21.3371 0.91 60.90ns
composite_subscription add 18.53ns 21.8887 0.85 92.70ns
composite_subscription unsubscribe 30.41ns 26.9413 1.13 29.86ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 748.19ns 738.121 1.01 1925.47ns
sending of values from observable via buffer to subscriber 6.03ns 4.82901 1.25 25.74ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 102.23ns 134.894 0.76 621.58ns
long stateful chain creation + subscribe 145.10ns 157.642 0.92 1336.19ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 455.26ns 418.5 1.09 .
sending of values from observable via combine_latest to subscriber 9.02ns 8.17365 1.10 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 1785.62ns 1803.0 0.99 3598.62ns
concat_with 1566.82ns 1658.39 0.94 3901.07ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 53.89ns 52.0584 1.04 299.69ns
sending of values from observable via distinct_until_changed to subscriber 2.01ns 2.00906 1.00 1.17ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 81.55ns 67.7081 1.20 690.85ns
sending of values from observable via first to subscriber 0.33ns 1.20643 0.28 1.01ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 36.34ns 37.2625 0.98 691.03ns
error 81.18ns 80.8931 1.00 771.25ns
never 14.46ns 14.6594 0.99 271.33ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 249.27ns 233.051 1.07 709.32ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.34ns 0.796847 1.68 124.75ns
re-schedule 10 times 7.72ns 7.25365 1.06 156.46ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 214.17ns 207.293 1.03 682.24ns
just send variadic 1209.68ns 1167.2 1.04 757.51ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 113.62ns 90.0311 1.26 421.33ns
sending of values from observable via last to subscriber 2.34ns 3.22829 0.73 1.34ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 30.36ns 40.9369 0.74 284.76ns
sending of values from observable via map to subscriber 1.34ns 0.804452 1.66 2.01ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 1739.97ns 1802.91 0.97 3537.96ns
merge_with 1553.43ns 1652.0 0.94 4341.71ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 550.43ns 551.5 1.00 2834.05ns
sending of values from observable via observe_on to subscriber 125.76ns 122.201 1.03 241.28ns

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 233.14ns 230.031 1.01 755.65ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 19.09ns 20.1568 0.95 14.74ns
on_error 0.67ns 0.805673 0.83 16.92ns
on_completed 0.67ns 0.806763 0.83 0.67ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 119.26ns 120.163 0.99 182.26ns
get_observable 7.95ns 10.7315 0.74 51.20ns
get_subscriber 19.69ns 29.9463 0.66 19.80ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 2176.97ns 2084.0 1.04 3298.06ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 46.17ns 47.1865 0.98 394.48ns
sending of values from observable via scan to subscriber 2.01ns 2.01121 1.00 2.39ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.01ns 3.14789 0.64 .
mutex lock increment 8.02ns 6.67834 1.20 .
spin-lock increment 9.03ns 10.4246 0.87 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 45.76ns 47.3387 0.97 526.08ns
sending of values from observable via skip to subscriber 2.01ns 2.08769 0.96 1.80ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 1802.28ns 1848.33 0.98 3643.44ns
sending of values from observable via switch_on_next to subscriber 4569.28ns 3908.52 1.17 799.18ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 82.07ns 82.7884 0.99 574.24ns
sending of values from observable via take to subscriber 2.35ns 2.4093 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 115.35ns 116.55 0.99 617.48ns
sending of values from observable via take_last to subscriber 2.38ns 3.25614 0.73 4.48ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 879.24ns 916.686 0.96 1397.07ns
sending of values from observable via take_until to subscriber 8.69ns 10.4421 0.83 2.34ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 786.46ns 795.465 0.99 16798.70ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 44.15ns 42.9969 1.03 14308.40ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 8.33ns 7.21646 1.15 182.48ns
re-schedule 10 times 27.86ns 24.5516 1.13 217.42ns
recursively schedule 10 times 1443.26ns 1343.89 1.07 8261.54ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 1591.13ns 1658.72 0.96 3405.96ns
sending of values from observable via window to subscriber 264.81ns 277.564 0.95 415.12ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 529.31ns 494.692 1.07 .
sending of values from observable via with_latest_from to subscriber 8.54ns 7.65835 1.12 .

ci-ubuntu-gcc

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.37ns 0.402203 0.92 0.39ns
Dynamic observable construction 33.93ns 28.9989 1.17 79.65ns
Specific observable construction + as_dynamic 37.05ns 29.0911 1.27 63.91ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 119.34ns 96.5615 1.24 822.91ns
Specific observable lift dynamic observer 144.01ns 130.093 1.11 883.13ns
Dynamic observable lift specific observer 227.87ns 191.542 1.19 963.51ns
Dynamic observable lift dynamic observer 227.91ns 208.359 1.09 1093.50ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 69.39ns 59.8869 1.16 797.64ns
Specific observable subscribe dynamic observer 218.16ns 77.2686 2.82 861.86ns
Dynamic observable subscribe specific observer 154.07ns 129.686 1.19 1078.86ns
Dynamic observable subscribe dynamic observer 154.07ns 133.558 1.15 847.73ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 70.33ns 60.5611 1.16 795.83ns
Dynamic observable subscribe lambda 151.62ns 129.814 1.17 969.44ns
Specific observable subscribe lambda without subscription 71.39ns 61.3155 1.16 794.07ns
Dynamic observable subscribe lambda without subscription 159.77ns 129.766 1.23 897.71ns
Specific observable subscribe specific subscriber 35.04ns 26.9698 1.30 702.72ns
Dynamic observable subscribe specific subscriber 118.84ns 97.1774 1.22 886.49ns
Specific observable subscribe dynamic observer 36.42ns 27.7856 1.31 721.20ns
Dynamic observable subscribe dynamic observer 100.58ns 91.0463 1.10 731.52ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.40ns 0.402181 1.00 0.39ns
Dynamic observer construction 36.04ns 30.267 1.19 50.42ns
Specific observer construction + as_dynamic 33.90ns 28.9209 1.17 59.89ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.39ns 0.440137 0.89 0.39ns
Dynamic observer OnNext 2.26ns 2.00552 1.13 2.43ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 40.78ns 35.3376 1.15 160.32ns
Make copy of subscriber 20.78ns 16.0654 1.29 38.17ns
Transform subsriber to dynamic 49.38ns 45.3189 1.09 86.87ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 42.49ns 34.127 1.25 138.01ns
composite_subscription add 55.19ns 51.6357 1.07 123.09ns
composite_subscription unsubscribe 51.69ns 44.8263 1.15 42.28ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1094.65ns 973.965 1.12 3524.20ns
sending of values from observable via buffer to subscriber 9.06ns 6.65873 1.36 39.24ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 454.11ns 324.813 1.40 1567.93ns
long stateful chain creation + subscribe 543.76ns 467.53 1.16 7542.40ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1045.95ns 853.717 1.23 .
sending of values from observable via combine_latest to subscriber 9.37ns 7.50533 1.25 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 3538.10ns 3099.79 1.14 8574.23ns
concat_with 3255.89ns 2863.45 1.14 9544.26ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 144.99ns 120.394 1.20 898.36ns
sending of values from observable via distinct_until_changed to subscriber 3.11ns 3.21247 0.97 1.60ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 203.09ns 146.706 1.38 1941.05ns
sending of values from observable via first to subscriber 0.77ns 1.20642 0.64 0.59ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 91.40ns 68.1344 1.34 2050.93ns
error 135.17ns 117.488 1.15 2007.43ns
never 43.38ns 29.0415 1.49 725.64ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 390.18ns 327.791 1.19 2120.99ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.09ns 1.19542 0.91 333.50ns
re-schedule 10 times 20.95ns 20.2072 1.04 360.08ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 372.44ns 300.826 1.24 2488.60ns
just send variadic 1592.20ns 1451.38 1.10 2086.25ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 250.60ns 182.518 1.37 1136.00ns
sending of values from observable via last to subscriber 4.00ns 1.84347 2.17 1.53ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 125.12ns 82.8481 1.51 856.22ns
sending of values from observable via map to subscriber 0.88ns 0.802501 1.10 3.60ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 3923.31ns 3057.49 1.28 10564.60ns
merge_with 3335.79ns 2837.18 1.18 10540.60ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 932.93ns 817.915 1.14 4964.85ns
sending of values from observable via observe_on to subscriber 177.95ns 156.652 1.14 616.50ns

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 538.08ns 462.812 1.16 1830.99ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 33.20ns 29.6801 1.12 18.03ns
on_error 0.80ns 0.808479 0.99 24.22ns
on_completed 0.80ns 0.807994 0.99 0.75ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 246.24ns 213.485 1.15 442.56ns
get_observable 30.93ns 33.3337 0.93 109.78ns
get_subscriber 63.68ns 63.6163 1.00 106.20ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 4871.56ns 4339.7 1.12 8333.47ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 139.21ns 114.449 1.22 1024.03ns
sending of values from observable via scan to subscriber 2.65ns 2.01125 1.32 1.87ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.77ns 2.10556 1.32 .
mutex lock increment 32.58ns 6.73693 4.84 .
spin-lock increment 13.41ns 10.4275 1.29 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 190.82ns 115.077 1.66 1246.53ns
sending of values from observable via skip to subscriber 3.15ns 3.07589 1.02 2.30ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 3862.54ns 3262.77 1.18 12266.00ns
sending of values from observable via switch_on_next to subscriber 904.81ns 832.941 1.09 3579.20ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 214.06ns 173.453 1.23 1538.29ns
sending of values from observable via take to subscriber 4.58ns 4.0492 1.13 3.89ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 263.24ns 216.404 1.22 1615.93ns
sending of values from observable via take_last to subscriber 4.02ns 3.04575 1.32 7.36ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1987.70ns 1663.44 1.19 4176.86ns
sending of values from observable via take_until to subscriber 13.59ns 11.9828 1.13 2.26ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1423.27ns 1120.14 1.27 17633.90ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 66.18ns 66.1562 1.00 2990.65ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 24.17ns 20.2926 1.19 425.28ns
re-schedule 10 times 50.75ns 40.9747 1.24 472.35ns
recursively schedule 10 times 1765.27ns 1473.71 1.20 25014.20ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 3285.18ns 2876.72 1.14 7056.59ns
sending of values from observable via window to subscriber 646.84ns 564.452 1.15 1105.96ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1241.13ns 1064.68 1.17 .
sending of values from observable via with_latest_from to subscriber 12.17ns 7.77856 1.56 .

ci-windows

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 1.50ns 1.80646 0.83 0.67ns
Dynamic observable construction 81.96ns 91.8944 0.89 122.70ns
Specific observable construction + as_dynamic 81.62ns 97.6367 0.84 122.49ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 147.06ns 173.28 0.85 1196.14ns
Specific observable lift dynamic observer 178.72ns 208.736 0.86 1258.19ns
Dynamic observable lift specific observer 284.09ns 339.247 0.84 1399.79ns
Dynamic observable lift dynamic observer 234.03ns 287.927 0.81 1307.55ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 111.26ns 136.389 0.82 1169.23ns
Specific observable subscribe dynamic observer 129.90ns 156.155 0.83 1204.45ns
Dynamic observable subscribe specific observer 264.57ns 274.426 0.96 1347.89ns
Dynamic observable subscribe dynamic observer 178.44ns 216.856 0.82 1233.00ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 109.93ns 168.156 0.65 1168.82ns
Dynamic observable subscribe lambda 230.41ns 272.3 0.85 1326.95ns
Specific observable subscribe lambda without subscription 109.49ns 132.876 0.82 1164.00ns
Dynamic observable subscribe lambda without subscription 227.48ns 263.216 0.86 1331.47ns
Specific observable subscribe specific subscriber 30.48ns 35.9267 0.85 840.50ns
Dynamic observable subscribe specific subscriber 149.16ns 177.428 0.84 1018.00ns
Specific observable subscribe dynamic observer 30.46ns 37.337 0.82 876.62ns
Dynamic observable subscribe dynamic observer 78.65ns 213.114 0.37 906.61ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 1.50ns 1.79835 0.84 1.50ns
Dynamic observer construction 83.04ns 100.433 0.83 111.94ns
Specific observer construction + as_dynamic 83.40ns 97.4633 0.86 113.24ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.774009 0.86 0.67ns
Dynamic observer OnNext 2.01ns 2.43616 0.82 1.71ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 86.04ns 104.138 0.83 346.82ns
Make copy of subscriber 16.73ns 19.1566 0.87 31.43ns
Transform subsriber to dynamic 96.72ns 116.639 0.83 149.21ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 84.53ns 101.004 0.84 339.57ns
composite_subscription add 71.80ns 86.4397 0.83 160.57ns
composite_subscription unsubscribe 65.57ns 77.5532 0.85 125.16ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1093.30ns 1306.52 0.84 4438.17ns
sending of values from observable via buffer to subscriber 7.00ns 7.65785 0.91 92.69ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 269.25ns 326.183 0.83 1735.07ns
long stateful chain creation + subscribe 665.17ns 813.816 0.82 3163.50ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1593.00ns 1981.21 0.80 .
sending of values from observable via combine_latest to subscriber 40.86ns 42.1423 0.97 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 4027.29ns 6410.14 0.63 10699.30ns
concat_with 4294.17ns 5676.67 0.76 11708.70ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 181.10ns 219.809 0.82 1024.28ns
sending of values from observable via distinct_until_changed to subscriber 3.68ns 4.01293 0.92 4.23ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 219.97ns 156.281 1.41 2620.90ns
sending of values from observable via first to subscriber 2.35ns 3.53771 0.66 1.74ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 62.55ns 78.1493 0.80 2389.45ns
error 111.34ns 134.471 0.83 2465.91ns
never 31.02ns 36.8086 0.84 880.92ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 514.78ns 638.556 0.81 2456.60ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 2.01ns 2.11162 0.95 411.71ns
re-schedule 10 times 107.83ns 117.574 0.92 440.55ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 405.05ns 502.217 0.81 2413.55ns
just send variadic 1305.89ns 1592.65 0.82 2482.40ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 313.47ns 269.0 1.17 1441.12ns
sending of values from observable via last to subscriber 4.37ns 4.05481 1.08 3.32ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 97.30ns 105.448 0.92 989.38ns
sending of values from observable via map to subscriber 4.00ns 4.5067 0.89 7.55ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 3956.14ns 6286.0 0.63 10975.30ns
merge_with 4139.17ns 4964.17 0.83 11678.70ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 1222.33ns 1512.19 0.81 5564.20ns
sending of values from observable via observe_on to subscriber 200.30ns 237.347 0.84 857.81ns

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 639.42ns 793.921 0.81 1812.85ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 19.94ns 22.7272 0.88 33.12ns
on_error 3.21ns 3.97673 0.81 18.35ns
on_completed 2.70ns 3.21023 0.84 0.68ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 355.05ns 420.154 0.85 590.50ns
get_observable 28.77ns 31.5879 0.91 163.90ns
get_subscriber 50.19ns 60.2642 0.83 93.76ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 6671.60ns 7142.6 0.93 11385.30ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 182.30ns 227.163 0.80 1236.29ns
sending of values from observable via scan to subscriber 5.44ns 6.62537 0.82 8.87ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 1.87ns 2.34682 0.80 .
mutex lock increment 25.74ns 31.7571 0.81 .
spin-lock increment 9.04ns 11.0832 0.82 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 176.46ns 216.12 0.82 1537.73ns
sending of values from observable via skip to subscriber 3.68ns 4.01532 0.92 3.51ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 4636.00ns 5954.83 0.78 12079.30ns
sending of values from observable via switch_on_next to subscriber 1085.57ns 1296.5 0.84 3114.00ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 224.33ns 271.573 0.83 2194.42ns
sending of values from observable via take to subscriber 5.91ns 6.70853 0.88 6.46ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 325.61ns 417.069 0.78 2462.55ns
sending of values from observable via take_last to subscriber 4.37ns 5.07748 0.86 20.21ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 2314.73ns 2795.64 0.83 5256.80ns
sending of values from observable via take_until to subscriber 11.51ns 13.8666 0.83 5.55ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1660.79ns 2128.71 0.78 5433.50ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 54.66ns 66.4587 0.82 1327.00ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 20.29ns 21.5694 0.94 937.14ns
re-schedule 10 times 121.57ns 224.63 0.54 645.58ns
recursively schedule 10 times 2644.30ns 3187.7 0.83 19151.00ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 3633.29ns 4487.88 0.81 9685.33ns
sending of values from observable via window to subscriber 821.42ns 992.516 0.83 1629.12ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1990.83ns 2640.0 0.75 .
sending of values from observable via with_latest_from to subscriber 27.77ns 34.1043 0.81 .

Please sign in to comment.