Skip to content

Commit

Permalink
Improve doxygen (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
victimsnino authored Dec 25, 2022
1 parent 4d52c08 commit b389d33
Show file tree
Hide file tree
Showing 13 changed files with 350 additions and 219 deletions.
2 changes: 1 addition & 1 deletion src/rpp/rpp/operators/fwd/filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct member_overload<Type, SpecificObservable, filter_tag>
* - <b>On subscribe</b>
* - None
* - <b>OnNext</b>
* - Just forwards emission of predicate returns true
* - Just forwards emission when predicate returns true
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
Expand Down
58 changes: 36 additions & 22 deletions src/rpp/rpp/operators/fwd/scan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,42 @@ struct scan_impl;
template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, scan_tag>
{
/**
* \brief Apply accumulator function for each emission from observable and result of accumulator from previous step and emit (and cache) resulting value
*
* \marble scan
{
source observable : +--1-2-3-|
operator "scan: s=1, (s,x)=>s+x" : +--2-4-7-|
}
*
* \param initial_value initial value for seed which will be applied for first value from observable (instead of emitting this as first value). Then it will be replaced with result and etc.
* \param accumulator function which accepts seed value and new value from observable and return new value of seed. Can accept seed by move-reference.
*
* \return new specific_observable with the scan operator as most recent operator.
* \warning #include <rpp/operators/scan.hpp>
*
* \par Example
* \snippet scan.cpp scan
* \snippet scan.cpp scan_vector
*
* \ingroup transforming_operators
* \see https://reactivex.io/documentation/operators/scan.html
*/
/**
* \brief Apply accumulator function for each emission from observable and result of accumulator from previous step and emit (and cache) resulting value
*
* \marble scan
{
source observable : +--1-2-3-|
operator "scan: s=1, (s,x)=>s+x" : +--2-4-7-|
}
*
* \details Acttually this operator applies provided accumulator function to seed and new emission, emits resulting value and updates seed value for next emission
*
* \param initial_value initial value for seed which will be applied for first value from observable (instead of emitting this as first value). Then it will be replaced with result and etc.
* \param accumulator function which accepts seed value and new value from observable and return new value of seed. Can accept seed by move-reference.
*
* \return new specific_observable with the scan operator as most recent operator.
* \warning #include <rpp/operators/scan.hpp>
*
* \par Example
* \snippet scan.cpp scan
* \snippet scan.cpp scan_vector
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store seed
* - <b>OnNext</b>
* - Applies accumulator to each emission
* - Updates seed value
* - Emits new seed value
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
* - Just forwards original on_completed
*
* \ingroup transforming_operators
* \see https://reactivex.io/documentation/operators/scan.html
*/
template<typename Result, scan_accumulator<Result, Type> AccumulatorFn>
auto scan(Result&& initial_value, AccumulatorFn&& accumulator) const & requires is_header_included<scan_tag, Result, AccumulatorFn>
{
Expand Down
80 changes: 47 additions & 33 deletions src/rpp/rpp/operators/fwd/skip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,54 @@ namespace rpp::details

namespace rpp::details
{
template<constraint::decayed_type Type>
struct skip_impl;
template<constraint::decayed_type Type>
struct skip_impl;

template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, skip_tag>
template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, skip_tag>
{
/**
* \brief Skip first `count` items provided by observable then send rest items as expected
*
* \marble skip
{
source observable : +--1-2-3-4-5-6-|
operator "skip(3)" : +--------4-5-6-|
}
*
* \details Actually this operator just decrements counter and starts to forward emissions when counter reaches zero.
*
* \param count amount of items to be skipped
* \return new specific_observable with the skip operator as most recent operator.
* \warning #include <rpp/operators/skip.hpp>
*
* \par Example:
* \snippet skip.cpp skip
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store counter
* - <b>OnNext</b>
* - Forwards emission if counter is zero
* - Decrements counter if not zero
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
* - Just forwards original on_completed
*
* \ingroup filtering_operators
* \see https://reactivex.io/documentation/operators/skip.html
*/
template<typename...Args>
auto skip(size_t count) const& requires is_header_included<skip_tag, Args...>
{
/**
* \brief Skip first `count` items provided by observable then send rest items as expected
*
* \marble skip
{
source observable : +--1-2-3-4-5-6-|
operator "skip(3)" : +--------4-5-6-|
}
* \param count amount of items to be skipped
* \return new specific_observable with the skip operator as most recent operator.
* \warning #include <rpp/operators/skip.hpp>
*
* \par Example:
* \snippet skip.cpp skip
*
* \ingroup filtering_operators
* \see https://reactivex.io/documentation/operators/skip.html
*/
template<typename...Args>
auto skip(size_t count) const& requires is_header_included<skip_tag, Args...>
{
return static_cast<const SpecificObservable*>(this)->template lift<Type>(skip_impl<Type>{count});
}
return static_cast<const SpecificObservable*>(this)->template lift<Type>(skip_impl<Type>{count});
}

template<typename...Args>
auto skip(size_t count) && requires is_header_included<skip_tag, Args...>
{
return std::move(*static_cast<SpecificObservable*>(this)).template lift<Type>(skip_impl<Type>{count});
}
};
template<typename...Args>
auto skip(size_t count) && requires is_header_included<skip_tag, Args...>
{
return std::move(*static_cast<SpecificObservable*>(this)).template lift<Type>(skip_impl<Type>{count});
}
};
} // namespace rpp::details
4 changes: 2 additions & 2 deletions src/rpp/rpp/operators/fwd/start_with.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct member_overload<Type, SpecificObservable, start_with_tag>
operator "start_with(1,2,3)" : +-1-2-3--4--6-|
}
*
* \details Actually it makes concat but arguments passed before current observable
* \details Actually it makes concat(rpp::source::just(vals_to_start_with)..., current_observable) so observables from argument subscribed before current observable
*
* \tparam memory_model memory_model strategy used to store provided values
* \param vals list of values which should be emitted before current observable
Expand Down Expand Up @@ -74,7 +74,7 @@ struct member_overload<Type, SpecificObservable, start_with_tag>
operator "start_with(-1-2-3-|)" : +--1-2-3--4--6-|
}
*
* \details Actually it makes concat but arguments passed before current observable
* \details Actually it makes concat(observables_to_start_with..., current_observable) so observables from argument subscribed before current observable
*
* \param observables list of observables which should be used before current observable
*
Expand Down
2 changes: 2 additions & 0 deletions src/rpp/rpp/operators/fwd/subscribe_on.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ struct member_overload<Type, SpecificObservable, subscribe_on_tag>
{
/**
* \brief OnSubscribe function for this observable will be scheduled via provided scheduler
*
* \details Actually this operator just schedules subscription on original observable to provided scheduler
*
* \param scheduler is scheduler used for scheduling of OnSubscribe
* \return new specific_observable with the subscribe_on operator as most recent operator.
Expand Down
87 changes: 50 additions & 37 deletions src/rpp/rpp/operators/fwd/switch_on_next.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,58 @@ namespace rpp::details

namespace rpp::details
{
template<constraint::decayed_type Type>
struct switch_on_next_impl;
template<constraint::decayed_type Type>
struct switch_on_next_impl;

template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, switch_on_next_tag>
{
/**
* \brief Converts observable of observables into observable of values which emits values from most recent underlying observable till new observable obtained
*
* \marble switch_on_next
{
source observable :
{
+--1-2-3-5--|
.....+4--6-9|
.......+7-8-|
}
operator "switch_on_next" : +--1-24-7-8|
}
*
* \return new specific_observable with the switch_on_next operator as most recent operator.
* \warning #include <rpp/operators/switch_on_next.hpp>
*
* \par Example:
* \snippet switch_on_next.cpp switch_on_next
*
* \ingroup combining_operators
* \see https://reactivex.io/documentation/operators/switch.html
*/
template<typename ...Args>
auto switch_on_next() const& requires (is_header_included<switch_on_next_tag, Args...>&& rpp::constraint::observable<Type>)
template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, switch_on_next_tag>
{
/**
* \brief Converts observable of observables into observable of values which emits values from most recent underlying observable till new observable obtained
*
* \marble switch_on_next
{
return static_cast<const SpecificObservable*>(this)->template lift<utils::extract_observable_type_t<Type>>(switch_on_next_impl<Type>());
source observable :
{
+--1-2-3-5--|
.....+4--6-9|
.......+7-8-|
}
operator "switch_on_next" : +--1-24-7-8|
}
*
* \details Actually this operator just unsubscribes from previous observable and subscribes on new observable when obtained in `on_next`
*
* \return new specific_observable with the switch_on_next operator as most recent operator.
* \warning #include <rpp/operators/switch_on_next.hpp>
*
* \par Example:
* \snippet switch_on_next.cpp switch_on_next
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store internal state
* - <b>OnNext</b>
* - Unsubscribed from previous observable (if any)
* - Subscribed on new emitted observable
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
* - Just forwards original on_completed if no any active inner observable or original observable yet
*
* \ingroup combining_operators
* \see https://reactivex.io/documentation/operators/switch.html
*/
template<typename ...Args>
auto switch_on_next() const& requires (is_header_included<switch_on_next_tag, Args...>&& rpp::constraint::observable<Type>)
{
return static_cast<const SpecificObservable*>(this)->template lift<utils::extract_observable_type_t<Type>>(switch_on_next_impl<Type>());
}

template<typename ...Args>
auto switch_on_next() && requires (is_header_included<switch_on_next_tag, Args...>&& rpp::constraint::observable<Type>)
{
return std::move(*static_cast<SpecificObservable*>(this)).template lift<utils::extract_observable_type_t<Type>>(switch_on_next_impl<Type>());
}
};
template<typename ...Args>
auto switch_on_next() && requires (is_header_included<switch_on_next_tag, Args...>&& rpp::constraint::observable<Type>)
{
return std::move(*static_cast<SpecificObservable*>(this)).template lift<utils::extract_observable_type_t<Type>>(switch_on_next_impl<Type>());
}
};
} // namespace rpp::details
50 changes: 32 additions & 18 deletions src/rpp/rpp/operators/fwd/take.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,38 @@ struct take_impl;
template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, take_tag>
{
/**
* \brief Emit only first `count` items provided by observable, then send `on_completed`
*
* \marble take
{
source observable : +--1-2-3-4-5-6-|
operator "take(3)" : +--1-2-3|
}
* \param count amount of items to be emitted. 0 - instant complete
* \return new specific_observable with the Take operator as most recent operator.
* \warning #include <rpp/operators/take.hpp>
*
* \par Example:
* \snippet take.cpp take
*
* \ingroup filtering_operators
* \see https://reactivex.io/documentation/operators/take.html
*/
/**
* \brief Emit only first `count` items provided by observable, then send `on_completed`
*
* \marble take
{
source observable : +--1-2-3-4-5-6-|
operator "take(3)" : +--1-2-3|
}
* \details Actually this operator just emits emissions while counter is not zero and decrements counter on each emission
*
* \param count amount of items to be emitted. 0 - instant complete
* \return new specific_observable with the Take operator as most recent operator.
* \warning #include <rpp/operators/take.hpp>
*
* \par Example:
* \snippet take.cpp take
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocate one `shared_ptr` to store counter
* - <b>OnNext</b>
* - Just forwards emission if counter is not zero
* - Decrements counter if not zero
* - If counter reached zero, then emits OnCompleted
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
* - Just forwards original on_completed
*
* \ingroup filtering_operators
* \see https://reactivex.io/documentation/operators/take.html
*/
template<typename...Args>
auto take(size_t count) const & requires is_header_included<take_tag, Args...>
{
Expand Down
51 changes: 32 additions & 19 deletions src/rpp/rpp/operators/fwd/take_last.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,38 @@ struct take_last_impl;
template<constraint::decayed_type Type, typename SpecificObservable>
struct member_overload<Type, SpecificObservable, take_last_tag>
{
/**
* \brief Emit only last `count` items provided by observable, then send `on_completed`
*
* \marble take_last
{
source observable : +--1-2-3-4-5-6-|
operator "take_last(3)" : +--------------456|
}
*
* \param count amount of last items to be emitted
* \return new specific_observable with the take_last operator as most recent operator.
* \warning #include <rpp/operators/take_last.hpp>
*
* \par Example
* \snippet take_last.cpp take_last
*
* \ingroup filtering_operators
* \see https://reactivex.io/documentation/operators/takelast.html
*/
/**
* \brief Emit only last `count` items provided by observable, then send `on_completed`
*
* \marble take_last
{
source observable : +--1-2-3-4-5-6-|
operator "take_last(3)" : +--------------456|
}
*
* \details Actually this operator has buffer of requested size inside, keeps last `count` values and emit stored values on `on_completed`
*
* \param count amount of last items to be emitted
* \return new specific_observable with the take_last operator as most recent operator.
* \warning #include <rpp/operators/take_last.hpp>
*
* \par Example
* \snippet take_last.cpp take_last
*
* \par Implementation details:
* - <b>On subscribe</b>
* - Allocates one `shared_ptr` to store internal buffer
* - <b>OnNext</b>
* - Place obtained value into queue
* - If queue contains more values than expected - remove oldest one
* - <b>OnError</b>
* - Just forwards original on_error
* - <b>OnCompleted</b>
* - Emits values stored in queue
*
* \ingroup filtering_operators
* \see https://reactivex.io/documentation/operators/takelast.html
*/
template<typename ...Args>
auto take_last(size_t count) const & requires is_header_included<take_last_tag, Args...>
{
Expand Down
Loading

1 comment on commit b389d33

@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.31ns 0.274051 1.15 0.30ns
Dynamic observable construction 79.13ns 68.828 1.15 111.22ns
Specific observable construction + as_dynamic 75.98ns 67.3661 1.13 108.98ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 163.96ns 137.746 1.19 1118.26ns
Specific observable lift dynamic observer 182.00ns 155.147 1.17 1185.27ns
Dynamic observable lift specific observer 265.67ns 237.661 1.12 1275.73ns
Dynamic observable lift dynamic observer 230.52ns 199.037 1.16 1200.33ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 119.65ns 133.517 0.90 1217.12ns
Specific observable subscribe dynamic observer 144.92ns 116.652 1.24 1098.40ns
Dynamic observable subscribe specific observer 232.94ns 199.06 1.17 1216.97ns
Dynamic observable subscribe dynamic observer 172.25ns 272.052 0.63 1130.33ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 116.73ns 131.178 0.89 1316.40ns
Dynamic observable subscribe lambda 209.73ns 216.612 0.97 1386.59ns
Specific observable subscribe lambda without subscription 111.94ns 103.755 1.08 1085.52ns
Dynamic observable subscribe lambda without subscription 252.06ns 197.341 1.28 1215.71ns
Specific observable subscribe specific subscriber 43.97ns 28.4583 1.55 848.38ns
Dynamic observable subscribe specific subscriber 154.51ns 127.302 1.21 976.63ns
Specific observable subscribe dynamic observer 33.00ns 29.732 1.11 977.74ns
Dynamic observable subscribe dynamic observer 77.50ns 69.2491 1.12 877.20ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.30ns 0.271906 1.09 0.29ns
Dynamic observer construction 74.32ns 69.7416 1.07 105.88ns
Specific observer construction + as_dynamic 70.66ns 70.6145 1.00 102.22ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.90ns 0.748917 1.20 0.88ns
Dynamic observer OnNext 2.35ns 1.97829 1.19 2.29ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 80.08ns 76.1391 1.05 310.34ns
Make copy of subscriber 13.98ns 11.9141 1.17 28.17ns
Transform subsriber to dynamic 97.03ns 85.5433 1.13 128.78ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 85.37ns 72.5646 1.18 295.56ns
composite_subscription add 65.32ns 55.0188 1.19 136.14ns
composite_subscription unsubscribe 87.76ns 70.7405 1.24 78.72ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1389.44ns 1290.46 1.08 3101.03ns
sending of values from observable via buffer to subscriber 6.02ns 5.498 1.10 87.45ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 242.96ns 207.847 1.17 1535.92ns
long stateful chain creation + subscribe 578.56ns 502.269 1.15 3020.93ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1314.47ns 1228.68 1.07 .
sending of values from observable via combine_latest to subscriber 24.96ns 22.2607 1.12 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 4865.31ns 3932.92 1.24 9523.81ns
concat_with 4259.73ns 4016.18 1.06 10486.10ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 168.54ns 163.274 1.03 891.84ns
sending of values from observable via distinct_until_changed to subscriber 2.35ns 2.11192 1.11 1.15ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 195.15ns 180.032 1.08 2327.66ns
sending of values from observable via first to subscriber 0.58ns 0.542916 1.07 0.94ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 65.81ns 71.3181 0.92 2135.62ns
error 122.76ns 106.836 1.15 2405.70ns
never 35.60ns 31.0012 1.15 843.67ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 683.44ns 582.31 1.17 2513.56ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 2.38ns 2.13698 1.11 431.62ns
re-schedule 10 times 26.76ns 24.1185 1.11 519.12ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 512.67ns 418.602 1.22 2453.27ns
just send variadic 1734.63ns 1767.44 0.98 2377.91ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 327.24ns 277.923 1.18 1477.60ns
sending of values from observable via last to subscriber 4.41ns 4.18551 1.05 1.55ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 70.29ns 63.3934 1.11 867.27ns
sending of values from observable via map to subscriber 1.11ns 1.0832 1.03 1.44ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 4432.87ns 3924.08 1.13 9670.42ns
merge_with 4864.26ns 3811.26 1.28 10104.10ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 1204.21ns 1128.93 1.07 31616.70ns
sending of values from observable via observe_on to subscriber 227.03ns 200.251 1.13 884.34ns

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 584.16ns 723.953 0.81 1587.38ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 23.34ns 20.2896 1.15 32.67ns
on_error 0.58ns 0.529865 1.09 19.21ns
on_completed 0.61ns 0.544543 1.12 2.50ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 350.08ns 310.054 1.13 579.68ns
get_observable 27.12ns 26.137 1.04 169.53ns
get_subscriber 62.73ns 50.7813 1.24 83.87ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 6244.87ns 5292.06 1.18 14030.20ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 168.75ns 136.173 1.24 1173.68ns
sending of values from observable via scan to subscriber 2.34ns 2.18092 1.07 2.01ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 1.84ns 1.72777 1.06 .
mutex lock increment 24.13ns 21.5722 1.12 .
spin-lock increment 10.01ns 7.84447 1.28 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 163.29ns 147.293 1.11 1385.71ns
sending of values from observable via skip to subscriber 2.29ns 2.03696 1.12 2.08ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 4814.19ns 4433.34 1.09 10104.40ns
sending of values from observable via switch_on_next to subscriber 1034.51ns 865.978 1.19 2511.18ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 202.62ns 182.496 1.11 2273.96ns
sending of values from observable via take to subscriber 3.02ns 2.82991 1.07 5.57ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 324.23ns 270.489 1.20 2018.40ns
sending of values from observable via take_last to subscriber 2.93ns 2.68619 1.09 5.99ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 2387.71ns 2276.06 1.05 5954.39ns
sending of values from observable via take_until to subscriber 8.47ns 7.67373 1.10 2.76ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 6699.65ns 5815.67 1.15 5518.89ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 68.14ns 66.3937 1.03 1175.40ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 42.29ns 27.8238 1.52 646.73ns
re-schedule 10 times 89.33ns 96.8769 0.92 727.99ns
recursively schedule 10 times 2107.54ns 1944.65 1.08 17297.80ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 3930.46ns 3779.06 1.04 8231.62ns
sending of values from observable via window to subscriber 959.74ns 800.279 1.20 1499.29ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1591.12ns 1568.52 1.01 .
sending of values from observable via with_latest_from to subscriber 23.15ns 24.5949 0.94 .

ci-ubuntu-clang

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.33ns 0.334815 1.00 0.34ns
Dynamic observable construction 18.49ns 18.3748 1.01 30.48ns
Specific observable construction + as_dynamic 17.72ns 18.0174 0.98 30.38ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 50.34ns 50.3968 1.00 323.85ns
Specific observable lift dynamic observer 51.03ns 51.0645 1.00 346.69ns
Dynamic observable lift specific observer 84.23ns 84.1599 1.00 372.99ns
Dynamic observable lift dynamic observer 74.91ns 74.9734 1.00 359.86ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 36.56ns 36.5688 1.00 333.88ns
Specific observable subscribe dynamic observer 37.29ns 37.3047 1.00 339.60ns
Dynamic observable subscribe specific observer 70.00ns 70.3054 1.00 361.72ns
Dynamic observable subscribe dynamic observer 59.89ns 59.8541 1.00 350.48ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 36.71ns 36.6298 1.00 319.94ns
Dynamic observable subscribe lambda 66.13ns 65.9432 1.00 363.50ns
Specific observable subscribe lambda without subscription 36.65ns 36.5289 1.00 318.92ns
Dynamic observable subscribe lambda without subscription 64.78ns 64.7543 1.00 361.35ns
Specific observable subscribe specific subscriber 13.75ns 13.7264 1.00 256.56ns
Dynamic observable subscribe specific subscriber 42.85ns 42.801 1.00 297.56ns
Specific observable subscribe dynamic observer 13.77ns 13.7802 1.00 268.83ns
Dynamic observable subscribe dynamic observer 33.55ns 33.6415 1.00 289.60ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.33ns 0.334476 1.00 0.34ns
Dynamic observer construction 18.07ns 18.0931 1.00 23.63ns
Specific observer construction + as_dynamic 17.63ns 19.1354 0.92 23.64ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.668861 1.00 0.67ns
Dynamic observer OnNext 1.68ns 1.67605 1.00 2.35ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 19.91ns 20.0473 0.99 67.73ns
Make copy of subscriber 7.00ns 6.9637 1.00 8.13ns
Transform subsriber to dynamic 19.73ns 19.7592 1.00 27.98ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 19.65ns 19.4234 1.01 60.44ns
composite_subscription add 18.01ns 18.5341 0.97 94.42ns
composite_subscription unsubscribe 30.33ns 30.412 1.00 29.88ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 738.63ns 748.186 0.99 1864.89ns
sending of values from observable via buffer to subscriber 6.03ns 6.02731 1.00 26.05ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 102.29ns 102.23 1.00 616.71ns
long stateful chain creation + subscribe 144.61ns 145.101 1.00 1372.72ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 455.25ns 455.264 1.00 .
sending of values from observable via combine_latest to subscriber 9.00ns 9.01576 1.00 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 1786.61ns 1785.62 1.00 3569.70ns
concat_with 1555.57ns 1566.82 0.99 3926.41ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 51.48ns 53.8934 0.96 299.98ns
sending of values from observable via distinct_until_changed to subscriber 2.03ns 2.00701 1.01 1.17ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 82.24ns 81.5514 1.01 686.66ns
sending of values from observable via first to subscriber 0.34ns 0.334987 1.00 1.01ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 36.59ns 36.3356 1.01 691.53ns
error 81.26ns 81.1799 1.00 773.37ns
never 14.55ns 14.4574 1.01 271.99ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 233.18ns 249.266 0.94 712.44ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.34ns 1.34121 1.00 122.82ns
re-schedule 10 times 7.72ns 7.72256 1.00 153.82ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 199.20ns 214.166 0.93 681.12ns
just send variadic 1146.70ns 1209.68 0.95 761.03ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 112.58ns 113.617 0.99 419.75ns
sending of values from observable via last to subscriber 2.34ns 2.34094 1.00 1.34ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 30.38ns 30.3591 1.00 285.58ns
sending of values from observable via map to subscriber 1.34ns 1.33728 1.00 2.01ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 1748.68ns 1739.97 1.01 3497.26ns
merge_with 1550.12ns 1553.43 1.00 4119.54ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 551.91ns 550.43 1.00 2810.39ns
sending of values from observable via observe_on to subscriber 125.91ns 125.764 1.00 240.54ns

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.91ns 233.138 1.00 757.12ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 19.08ns 19.0904 1.00 14.88ns
on_error 0.67ns 0.67273 1.00 16.98ns
on_completed 0.67ns 0.672535 1.00 0.67ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 126.14ns 119.263 1.06 183.31ns
get_observable 7.94ns 7.94628 1.00 50.55ns
get_subscriber 19.71ns 19.6922 1.00 19.78ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 2198.09ns 2176.97 1.01 3312.53ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 46.02ns 46.1715 1.00 373.66ns
sending of values from observable via scan to subscriber 2.01ns 2.00681 1.00 2.34ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.01ns 2.00796 1.00 .
mutex lock increment 8.04ns 8.01798 1.00 .
spin-lock increment 9.04ns 9.02758 1.00 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 45.69ns 45.762 1.00 526.44ns
sending of values from observable via skip to subscriber 2.03ns 2.00979 1.01 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 1787.52ns 1802.28 0.99 3527.16ns
sending of values from observable via switch_on_next to subscriber 4532.56ns 4569.28 0.99 801.69ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 81.82ns 82.0685 1.00 590.23ns
sending of values from observable via take to subscriber 2.35ns 2.34612 1.00 2.69ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 113.11ns 115.35 0.98 615.82ns
sending of values from observable via take_last to subscriber 2.38ns 2.38244 1.00 4.11ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 880.66ns 879.244 1.00 1386.61ns
sending of values from observable via take_until to subscriber 8.71ns 8.69372 1.00 2.35ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 789.54ns 786.459 1.00 18143.50ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 41.32ns 44.1474 0.94 15157.10ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 8.37ns 8.33059 1.00 198.66ns
re-schedule 10 times 28.05ns 27.8634 1.01 215.49ns
recursively schedule 10 times 1410.47ns 1443.26 0.98 8425.30ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 1584.39ns 1591.13 1.00 3329.94ns
sending of values from observable via window to subscriber 264.61ns 264.81 1.00 417.70ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 529.56ns 529.308 1.00 .
sending of values from observable via with_latest_from to subscriber 8.62ns 8.54339 1.01 .

ci-ubuntu-gcc

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 0.36ns 0.371512 0.98 0.39ns
Dynamic observable construction 32.29ns 33.9305 0.95 55.36ns
Specific observable construction + as_dynamic 35.71ns 37.054 0.96 90.84ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 104.33ns 119.345 0.87 751.32ns
Specific observable lift dynamic observer 143.73ns 144.009 1.00 891.95ns
Dynamic observable lift specific observer 189.40ns 227.868 0.83 894.82ns
Dynamic observable lift dynamic observer 216.27ns 227.907 0.95 864.80ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 88.92ns 69.393 1.28 726.00ns
Specific observable subscribe dynamic observer 80.62ns 218.163 0.37 853.36ns
Dynamic observable subscribe specific observer 137.36ns 154.071 0.89 859.46ns
Dynamic observable subscribe dynamic observer 157.85ns 154.069 1.02 987.28ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 59.02ns 70.3295 0.84 710.40ns
Dynamic observable subscribe lambda 128.71ns 151.616 0.85 814.30ns
Specific observable subscribe lambda without subscription 68.00ns 71.3949 0.95 761.14ns
Dynamic observable subscribe lambda without subscription 141.99ns 159.771 0.89 912.80ns
Specific observable subscribe specific subscriber 32.92ns 35.0386 0.94 685.14ns
Dynamic observable subscribe specific subscriber 101.85ns 118.837 0.86 787.03ns
Specific observable subscribe dynamic observer 35.41ns 36.4191 0.97 751.05ns
Dynamic observable subscribe dynamic observer 99.61ns 100.577 0.99 700.98ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 0.38ns 0.402676 0.94 0.36ns
Dynamic observer construction 34.79ns 36.0361 0.97 46.73ns
Specific observer construction + as_dynamic 33.86ns 33.9043 1.00 54.17ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.37ns 0.393801 0.93 0.38ns
Dynamic observer OnNext 2.07ns 2.25742 0.92 2.29ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 38.07ns 40.781 0.93 133.92ns
Make copy of subscriber 20.30ns 20.7807 0.98 29.94ns
Transform subsriber to dynamic 47.32ns 49.3827 0.96 86.85ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 39.31ns 42.4897 0.93 130.77ns
composite_subscription add 52.98ns 55.1938 0.96 144.77ns
composite_subscription unsubscribe 52.93ns 51.6945 1.02 42.18ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1031.55ns 1094.65 0.94 3381.78ns
sending of values from observable via buffer to subscriber 7.47ns 9.06263 0.82 36.98ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 291.47ns 454.108 0.64 1599.59ns
long stateful chain creation + subscribe 438.40ns 543.756 0.81 7734.79ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 928.64ns 1045.95 0.89 .
sending of values from observable via combine_latest to subscriber 8.82ns 9.36904 0.94 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 3066.50ns 3538.1 0.87 9271.26ns
concat_with 2741.50ns 3255.89 0.84 9444.68ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 125.49ns 144.991 0.87 886.00ns
sending of values from observable via distinct_until_changed to subscriber 2.64ns 3.11186 0.85 1.38ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 179.55ns 203.086 0.88 1958.73ns
sending of values from observable via first to subscriber 0.80ns 0.770513 1.04 0.53ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 81.51ns 91.403 0.89 1737.93ns
error 126.83ns 135.172 0.94 2111.57ns
never 35.30ns 43.3783 0.81 726.03ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 340.75ns 390.184 0.87 1905.43ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 1.26ns 1.09126 1.16 290.02ns
re-schedule 10 times 19.67ns 20.9517 0.94 363.88ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 329.37ns 372.444 0.88 1853.50ns
just send variadic 1616.06ns 1592.2 1.01 1856.86ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 237.25ns 250.604 0.95 1100.64ns
sending of values from observable via last to subscriber 3.73ns 4.00161 0.93 1.32ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 92.26ns 125.122 0.74 748.94ns
sending of values from observable via map to subscriber 0.76ns 0.884597 0.86 1.52ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 3159.91ns 3923.31 0.81 11320.00ns
merge_with 3211.90ns 3335.79 0.96 10553.30ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 871.34ns 932.935 0.93 5145.15ns
sending of values from observable via observe_on to subscriber 201.00ns 177.952 1.13 549.54ns

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 662.46ns 538.081 1.23 1616.07ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 26.21ns 33.203 0.79 17.75ns
on_error 0.69ns 0.796798 0.87 18.39ns
on_completed 0.69ns 0.801808 0.86 0.65ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 253.65ns 246.238 1.03 389.97ns
get_observable 32.18ns 30.9331 1.04 109.61ns
get_subscriber 54.93ns 63.6835 0.86 157.21ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 4372.86ns 4871.56 0.90 8218.26ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 129.85ns 139.214 0.93 1016.48ns
sending of values from observable via scan to subscriber 2.69ns 2.64883 1.02 1.72ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 2.60ns 2.76882 0.94 .
mutex lock increment 9.55ns 32.5833 0.29 .
spin-lock increment 13.67ns 13.4117 1.02 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 132.97ns 190.821 0.70 1216.19ns
sending of values from observable via skip to subscriber 2.89ns 3.14933 0.92 2.47ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 3475.34ns 3862.54 0.90 11410.00ns
sending of values from observable via switch_on_next to subscriber 959.04ns 904.81 1.06 3214.88ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 188.95ns 214.058 0.88 1596.48ns
sending of values from observable via take to subscriber 4.09ns 4.58373 0.89 3.42ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 233.16ns 263.237 0.89 1713.79ns
sending of values from observable via take_last to subscriber 3.98ns 4.01641 0.99 7.20ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 1834.00ns 1987.7 0.92 3868.29ns
sending of values from observable via take_until to subscriber 11.70ns 13.5938 0.86 2.23ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1123.96ns 1423.27 0.79 14587.20ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 65.31ns 66.1769 0.99 2935.45ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 22.95ns 24.1687 0.95 383.70ns
re-schedule 10 times 51.92ns 50.7473 1.02 466.21ns
recursively schedule 10 times 1535.22ns 1765.27 0.87 26468.50ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 2970.10ns 3285.18 0.90 7267.81ns
sending of values from observable via window to subscriber 548.58ns 646.838 0.85 1118.57ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 1241.35ns 1241.13 1.00 .
sending of values from observable via with_latest_from to subscriber 9.49ns 12.1654 0.78 .

ci-windows

Observable construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable construction 1.54ns 1.50388 1.03 0.67ns
Dynamic observable construction 80.23ns 81.9644 0.98 123.12ns
Specific observable construction + as_dynamic 80.19ns 81.6238 0.98 123.15ns

Observable lift

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable lift specific observer 145.93ns 147.057 0.99 1213.00ns
Specific observable lift dynamic observer 178.79ns 178.721 1.00 1274.71ns
Dynamic observable lift specific observer 282.89ns 284.09 1.00 1425.78ns
Dynamic observable lift dynamic observer 234.85ns 234.028 1.00 1308.65ns

Observable subscribe

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe specific observer 109.76ns 111.259 0.99 1182.23ns
Specific observable subscribe dynamic observer 129.37ns 129.903 1.00 1211.59ns
Dynamic observable subscribe specific observer 227.60ns 264.568 0.86 1362.37ns
Dynamic observable subscribe dynamic observer 178.13ns 178.437 1.00 1242.86ns

Observable subscribe #2

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observable subscribe lambda 109.40ns 109.926 1.00 1474.77ns
Dynamic observable subscribe lambda 228.75ns 230.409 0.99 1352.63ns
Specific observable subscribe lambda without subscription 109.36ns 109.494 1.00 1225.82ns
Dynamic observable subscribe lambda without subscription 226.56ns 227.477 1.00 1357.83ns
Specific observable subscribe specific subscriber 30.47ns 30.475 1.00 843.03ns
Dynamic observable subscribe specific subscriber 146.13ns 149.158 0.98 1024.14ns
Specific observable subscribe dynamic observer 30.50ns 30.4614 1.00 882.32ns
Dynamic observable subscribe dynamic observer 78.68ns 78.652 1.00 936.50ns

Observer construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer construction 1.50ns 1.50447 1.00 1.50ns
Dynamic observer construction 81.84ns 83.0369 0.99 113.83ns
Specific observer construction + as_dynamic 81.75ns 83.4013 0.98 114.82ns

OnNext

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Specific observer OnNext 0.67ns 0.668938 1.00 0.67ns
Dynamic observer OnNext 2.01ns 2.00652 1.00 1.77ns

Subscriber construction

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
Make subsriber 84.21ns 86.0373 0.98 354.72ns
Make copy of subscriber 16.72ns 16.7311 1.00 31.43ns
Transform subsriber to dynamic 95.73ns 96.7192 0.99 154.78ns

Subscription

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
composite_subscription create 84.64ns 84.5322 1.00 348.57ns
composite_subscription add 73.00ns 71.8039 1.02 161.32ns
composite_subscription unsubscribe 62.97ns 65.5663 0.96 148.22ns

buffer

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
buffer 1083.09ns 1093.3 0.99 4505.67ns
sending of values from observable via buffer to subscriber 6.98ns 6.99507 1.00 90.48ns

chains creation test

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
long non-state chain creation + subscribe 269.28ns 269.25 1.00 1731.57ns
long stateful chain creation + subscribe 663.11ns 665.167 1.00 3177.38ns

combine_latest

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
combine_latest construction from observable via dot + subscribe 1773.71ns 1593.0 1.11 .
sending of values from observable via combine_latest to subscriber 35.31ns 40.8601 0.86 .

concat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
concat 4049.29ns 4027.29 1.01 10635.30ns
concat_with 4269.00ns 4294.17 0.99 11708.30ns

distinct_until_changed

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
distinct_until_changed construction from observable via dot + subscribe 183.32ns 181.101 1.01 1024.00ns
sending of values from observable via distinct_until_changed to subscriber 3.69ns 3.68071 1.00 4.22ns

first

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
first construction from observable via dot + subscribe 220.10ns 219.97 1.00 2638.80ns
sending of values from observable via first to subscriber 2.34ns 2.34507 1.00 1.77ns

foundamental sources

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
empty 62.83ns 62.5514 1.00 2411.09ns
error 111.91ns 111.337 1.01 2480.10ns
never 31.05ns 31.0207 1.00 885.65ns

from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
from vector with int 513.35ns 514.783 1.00 2465.50ns

immediate scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 2.01ns 2.00904 1.00 469.08ns
re-schedule 10 times 97.72ns 107.834 0.91 437.83ns

just

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
just send int 379.69ns 405.048 0.94 2417.40ns
just send variadic 1304.95ns 1305.89 1.00 2519.50ns

last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
last construction from observable via dot + subscribe 314.90ns 313.466 1.00 1436.71ns
sending of values from observable via last to subscriber 4.37ns 4.37448 1.00 3.48ns

map

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
map construction from observable via dot + subscribe 88.41ns 97.2986 0.91 990.88ns
sending of values from observable via map to subscriber 3.99ns 3.99891 1.00 7.52ns

merge

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
merge 5269.71ns 3956.14 1.33 10966.70ns
merge_with 4833.71ns 4139.17 1.17 11830.50ns

observe_on

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
observe_on construction from observable via dot + subscribe 1233.81ns 1222.33 1.01 5908.80ns
sending of values from observable via observe_on to subscriber 200.22ns 200.304 1.00 856.46ns

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 639.421 1.00 1829.08ns

publish_subject callbacks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
on_next 19.72ns 19.9376 0.99 32.56ns
on_error 3.04ns 3.20838 0.95 18.35ns
on_completed 2.70ns 2.70472 1.00 0.68ns

publish_subject routines

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
construct 358.41ns 355.048 1.01 596.38ns
get_observable 29.89ns 28.7688 1.04 163.51ns
get_subscriber 50.18ns 50.1911 1.00 93.86ns

repeat

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
repeat construction from observable via dot + subscribe 6043.80ns 6671.6 0.91 12130.30ns

scan

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
scan construction from observable via dot + subscribe 183.88ns 182.304 1.01 1254.58ns
sending of values from observable via scan to subscriber 5.39ns 5.43685 0.99 11.85ns

single-threaded locks

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no-lock increment 1.87ns 1.8725 1.00 .
mutex lock increment 25.75ns 25.7418 1.00 .
spin-lock increment 9.03ns 9.03662 1.00 .

skip

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
skip construction from observable via dot + subscribe 176.46ns 176.462 1.00 1538.71ns
sending of values from observable via skip to subscriber 3.68ns 3.68036 1.00 5.36ns

switch_on_next

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
switch_on_next construction from observable via dot + subscribe 4666.00ns 4636.0 1.01 12297.30ns
sending of values from observable via switch_on_next to subscriber 1099.75ns 1085.57 1.01 3211.56ns

take

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take construction from observable via dot + subscribe 226.27ns 224.333 1.01 2161.92ns
sending of values from observable via take to subscriber 5.82ns 5.90785 0.99 6.49ns

take_last

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_last construction from observable via dot + subscribe 322.66ns 325.606 0.99 2458.00ns
sending of values from observable via take_last to subscriber 4.37ns 4.37227 1.00 21.43ns

take_until

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
take_until construction from observable via dot + subscribe 2317.18ns 2314.73 1.00 5280.40ns
sending of values from observable via take_until to subscriber 11.40ns 11.5115 0.99 5.57ns

timeout

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
timeout construction from observable via dot + subscribe with run_loop 1643.00ns 1660.79 0.99 5466.25ns
sending of values from observable via timeout to subscriber with unreachable timeout interval with run_loop 54.43ns 54.6624 1.00 1344.06ns

trampoline scheduler

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
no any re-schedule 21.20ns 20.289 1.04 611.19ns
re-schedule 10 times 121.75ns 121.567 1.00 646.20ns
recursively schedule 10 times 2664.00ns 2644.3 1.01 19153.50ns

window

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
window 3651.57ns 3633.29 1.01 9747.67ns
sending of values from observable via window to subscriber 821.28ns 821.419 1.00 1640.43ns

with_latest_from

Table
Test Name Current, ns Prev, ns Ratio RxCpp current, ns
with_latest_from construction from observable via dot + subscribe 2015.58ns 1990.83 1.01 .
sending of values from observable via with_latest_from to subscriber 29.23ns 27.7723 1.05 .

Please sign in to comment.