summaryrefslogtreecommitdiff
path: root/Rx
diff options
context:
space:
mode:
authorKirk Shoop <kirk.shoop@microsoft.com>2015-06-23 18:40:32 -0700
committerKirk Shoop <kirk.shoop@microsoft.com>2015-06-23 18:40:32 -0700
commit01a89e0d1e8fa8c547b8e180d4c8d32c4c14e2dd (patch)
treee6d24720106c18f7becd2623152993f1ecccc826 /Rx
parente4fd9d539cedb6a8b2228bde0ae011cfc0b341cc (diff)
downloadRxCpp-01a89e0d1e8fa8c547b8e180d4c8d32c4c14e2dd.tar.gz
perf test updates
Diffstat (limited to 'Rx')
-rw-r--r--Rx/v2/test/operators/observe_on.cpp6
-rw-r--r--Rx/v2/test/subjects/subject.cpp20
-rw-r--r--Rx/v2/test/subscriptions/subscription.cpp2
3 files changed, 14 insertions, 14 deletions
diff --git a/Rx/v2/test/operators/observe_on.cpp b/Rx/v2/test/operators/observe_on.cpp
index fd0a0f8..ce409bf 100644
--- a/Rx/v2/test/operators/observe_on.cpp
+++ b/Rx/v2/test/operators/observe_on.cpp
@@ -10,7 +10,7 @@ namespace rxsub=rxcpp::subjects;
const int static_onnextcalls = 100000;
-SCENARIO("range observed on current_thread", "[hide][range][observe_on_debug][observe_on][long][perf]"){
+SCENARIO("range observed on new_thread", "[hide][range][observe_on_debug][observe_on][long][perf]"){
const int& onnextcalls = static_onnextcalls;
GIVEN("a range"){
WHEN("multicasting a million ints"){
@@ -35,6 +35,7 @@ SCENARIO("range observed on current_thread", "[hide][range][observe_on_debug][ob
rxs::range<int>(1)
.take(onnextcalls)
.observe_on(el)
+ .as_blocking()
.subscribe(
cs,
[c](int){
@@ -43,12 +44,11 @@ SCENARIO("range observed on current_thread", "[hide][range][observe_on_debug][ob
[&](){
done = true;
});
- while(!done || !disposed);
auto expected = onnextcalls;
REQUIRE(*c == expected);
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "range -> observe_on current_thread : " << (*c) << " on_next calls, " << msElapsed.count() << "ms elapsed, int-per-second " << *c / (msElapsed.count() / 1000.0) << std::endl;
+ std::cout << "range -> observe_on new_thread : " << (*c) << " on_next calls, " << msElapsed.count() << "ms elapsed, int-per-second " << *c / (msElapsed.count() / 1000.0) << std::endl;
}
}
}
diff --git a/Rx/v2/test/subjects/subject.cpp b/Rx/v2/test/subjects/subject.cpp
index e1e91a0..921b7d0 100644
--- a/Rx/v2/test/subjects/subject.cpp
+++ b/Rx/v2/test/subjects/subject.cpp
@@ -13,7 +13,7 @@ namespace rxsub=rxcpp::subjects;
#include <future>
-const int static_onnextcalls = 100000000;
+const int static_onnextcalls = 10000000;
static int aliased = 0;
SCENARIO("for loop locks mutex", "[hide][for][mutex][long][perf]"){
@@ -33,7 +33,7 @@ SCENARIO("for loop locks mutex", "[hide][for][mutex][long][perf]"){
}
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "loop mutex : " << n << " subscribed, " << c << " on_next calls, " << msElapsed.count() << "ms elapsed " << std::endl;
+ std::cout << "loop mutex : " << n << " subscribed, " << c << " on_next calls, " << msElapsed.count() << "ms elapsed " << c / (msElapsed.count() / 1000.0) << " ops/sec" << std::endl;
}
}
@@ -76,7 +76,7 @@ SCENARIO("for loop calls void on_next(int)", "[hide][for][asyncobserver][baselin
}
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "loop void : " << n << " subscribed, " << *c << " on_next calls, " << msElapsed.count() << "ms elapsed " << std::endl;
+ std::cout << "loop void : " << n << " subscribed, " << *c << " on_next calls, " << msElapsed.count() << "ms elapsed " << *c / (msElapsed.count() / 1000.0) << " ops/sec" << std::endl;
}
}
@@ -170,7 +170,7 @@ SCENARIO("for loop calls ready on_next(int)", "[hide][for][asyncobserver][ready]
chunk();
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "loop ready : " << n << " subscribed, " << *c << " on_next calls, " << msElapsed.count() << "ms elapsed " << std::endl;
+ std::cout << "loop ready : " << n << " subscribed, " << *c << " on_next calls, " << msElapsed.count() << "ms elapsed " << *c / (msElapsed.count() / 1000.0) << " ops/sec" << std::endl;
}
}
@@ -218,7 +218,7 @@ SCENARIO("for loop calls std::future<unit> on_next(int)", "[hide][for][asyncobse
}
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "loop future<unit> : " << n << " subscribed, " << *c << " on_next calls, " << msElapsed.count() << "ms elapsed " << std::endl;
+ std::cout << "loop future<unit> : " << n << " subscribed, " << *c << " on_next calls, " << msElapsed.count() << "ms elapsed " << *c / (msElapsed.count() / 1000.0) << " ops/sec" << std::endl;
}
}
@@ -245,7 +245,7 @@ SCENARIO("for loop calls observer", "[hide][for][observer][perf]"){
o.on_completed();
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "loop -> observer : " << n << " subscribed, " << c << " on_next calls, " << msElapsed.count() << "ms elapsed " << std::endl;
+ std::cout << "loop -> observer : " << n << " subscribed, " << c << " on_next calls, " << msElapsed.count() << "ms elapsed " << c / (msElapsed.count() / 1000.0) << " ops/sec"<< std::endl;
}
}
}
@@ -271,7 +271,7 @@ SCENARIO("for loop calls subscriber", "[hide][for][subscriber][perf]"){
o.on_completed();
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "loop -> subscriber : " << n << " subscribed, " << c << " on_next calls, " << msElapsed.count() << "ms elapsed " << std::endl;
+ std::cout << "loop -> subscriber : " << n << " subscribed, " << c << " on_next calls, " << msElapsed.count() << "ms elapsed " << c / (msElapsed.count() / 1000.0) << " ops/sec" << std::endl;
}
}
}
@@ -297,7 +297,7 @@ SCENARIO("range calls subscriber", "[hide][range][subscriber][perf]"){
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "range -> subscriber : " << n << " subscribed, " << c << " on_next calls, " << msElapsed.count() << "ms elapsed " << std::endl;
+ std::cout << "range -> subscriber : " << n << " subscribed, " << c << " on_next calls, " << msElapsed.count() << "ms elapsed " << c / (msElapsed.count() / 1000.0) << " ops/sec" << std::endl;
}
}
}
@@ -362,7 +362,7 @@ SCENARIO("for loop calls subject", "[hide][for][subject][subjects][long][perf]")
o.on_completed();
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "loop -> subject : " << n << " subscribed, " << (*c) << " on_next calls, " << msElapsed.count() << "ms elapsed " << std::endl;
+ std::cout << "loop -> subject : " << n << " subscribed, " << (*c) << " on_next calls, " << msElapsed.count() << "ms elapsed " << *c / (msElapsed.count() / 1000.0) << " ops/sec" << std::endl;
}
}
}
@@ -426,7 +426,7 @@ SCENARIO("range calls subject", "[hide][range][subject][subjects][long][perf]"){
.subscribe(o);
auto finish = clock::now();
auto msElapsed = duration_cast<milliseconds>(finish-start);
- std::cout << "range -> subject : " << n << " subscribed, " << (*c) << " on_next calls, " << msElapsed.count() << "ms elapsed " << std::endl;
+ std::cout << "range -> subject : " << n << " subscribed, " << (*c) << " on_next calls, " << msElapsed.count() << "ms elapsed " << *c / (msElapsed.count() / 1000.0) << " ops/sec"<< std::endl;
}
}
}
diff --git a/Rx/v2/test/subscriptions/subscription.cpp b/Rx/v2/test/subscriptions/subscription.cpp
index dd74fff..a8f269d 100644
--- a/Rx/v2/test/subscriptions/subscription.cpp
+++ b/Rx/v2/test/subscriptions/subscription.cpp
@@ -21,7 +21,7 @@ SCENARIO("observe subscription", "[hide]"){
}
}
-static const int static_subscriptions = 100000;
+static const int static_subscriptions = 10000;
SCENARIO("for loop subscribes to map", "[hide][for][just][subscribe][long][perf]"){
const int& subscriptions = static_subscriptions;