20 #include <gflags/gflags.h> 30 for (
uint32_t iter = 0; iter < iters; iter++) {
33 std::vector<std::unique_ptr<Observer<int>>> observers;
34 std::vector<Subscription<int>> subscriptions;
35 subscriptions.reserve(N);
36 for (
int i = 0;
i < N;
i++) {
40 for (
int i = 0;
i < N;
i++) {
43 if (countUnsubscribe) {
44 subscriptions.clear();
59 for (
uint32_t iter = 0; iter < iters; iter++) {
62 std::vector<std::unique_ptr<Observer<int>>> observers;
63 for (
int i = 0;
i < N;
i++) {
67 for (
int i = 0;
i < N;
i++) {
75 for (
uint32_t iter = 0; iter < iters; iter++) {
78 std::vector<Observer<int>*> observers;
79 for (
int i = 0;
i < N;
i++) {
83 for (
int i = 0;
i < N;
i++) {
87 for (
int i = 0;
i < N;
i++) {
94 for (
uint32_t iter = 0; iter < iters; iter++) {
97 std::vector<std::unique_ptr<Observer<int>>> observers;
98 std::vector<Subscription<int>> subscriptions;
99 subscriptions.reserve(N);
100 for (
int i = 0;
i < N;
i++) {
103 for (
int i = 0;
i < N;
i++) {
113 for (
uint32_t iter = 0; iter < iters; iter++) {
116 std::vector<Observer<int>*> observers;
117 for (
int i = 0;
i < N;
i++) {
120 for (
int i = 0;
i < N;
i++) {
152 gflags::ParseCommandLineFlags(&argc, &
argv,
true);
virtual void observe(ObserverPtr< T > observer)
void subscribeAndUnsubscribe(uint32_t iters, int N)
virtual Subscription< T > subscribe(ObserverPtr< T > observer)
void subscribe(uint32_t iters, int N)
constexpr detail::Map< Move > move
void notifySubscribers(uint32_t iters, int N)
void observe(uint32_t iters, int N)
static std::unique_ptr< Observer< int > > makeObserver()
void onNext(const T &val) override
int main(int argc, char **argv)
void notifyInlineObservers(uint32_t iters, int N)
void inlineObserve(uint32_t iters, int N)
#define BENCHMARK_PARAM(name, param)
#define BENCHMARK_RELATIVE_PARAM(name, param)
void subscribeImpl(uint32_t iters, int N, bool countUnsubscribe)
static std::unique_ptr< Observer > create(N &&onNextFn, E &&onErrorFn, C &&onCompletedFn)