本文整理汇总了C++中BenchmarkSuspender::dismiss方法的典型用法代码示例。如果您正苦于以下问题:C++ BenchmarkSuspender::dismiss方法的具体用法?C++ BenchmarkSuspender::dismiss怎么用?C++ BenchmarkSuspender::dismiss使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BenchmarkSuspender
的用法示例。
在下文中一共展示了BenchmarkSuspender::dismiss方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeBench
void writeBench(size_t iter) {
BenchmarkSuspender susp;
auto strct = create<Struct>();
susp.dismiss();
while (iter--) {
IOBufQueue q;
Serializer::serialize(strct, &q);
folly::doNotOptimizeAway(q);
}
susp.rehire();
}
示例2: writeBench
void writeBench(size_t iters) {
BenchmarkSuspender susp;
auto strct = create<Struct>();
susp.dismiss();
while (iters--) {
IOBufQueue q;
Serializer::serialize(strct, &q);
}
susp.rehire();
}
示例3: readBench
void readBench(size_t iters) {
BenchmarkSuspender susp;
auto strct = create<Struct>();
IOBufQueue q;
Serializer::serialize(strct, &q);
auto buf = q.move();
susp.dismiss();
while (iters--) {
Struct data;
Serializer::deserialize(buf.get(), data);
}
susp.rehire();
}
示例4: readBench
void readBench(size_t iter) {
BenchmarkSuspender susp;
auto strct = create<Struct>();
string s;
strct.SerializeToString(&s);
susp.dismiss();
while (iter--) {
Struct data;
data.ParseFromString(s);
folly::doNotOptimizeAway(data);
}
susp.rehire();
}
示例5: observe
void observe(uint iters, int N) {
for (uint iter = 0; iter < iters; iter++) {
BenchmarkSuspender bs;
Subject<int> subject;
std::vector<std::unique_ptr<Observer<int>>> observers;
for (int i = 0; i < N; i++) {
observers.push_back(makeObserver());
}
bs.dismiss();
for (int i = 0; i < N; i++) {
subject.observe(std::move(observers[i]));
}
bs.rehire();
}
}
示例6: notifyInlineObservers
void notifyInlineObservers(uint iters, int N) {
for (uint iter = 0; iter < iters; iter++) {
BenchmarkSuspender bs;
Subject<int> subject;
std::vector<Observer<int>*> observers;
for (int i = 0; i < N; i++) {
observers.push_back(makeObserver().release());
}
for (int i = 0; i < N; i++) {
subject.observe(observers[i]);
}
bs.dismiss();
subject.onNext(42);
bs.rehire();
}
}
示例7: addValue
void addValue(unsigned int iters,
seconds duration, size_t numBuckets,
size_t callsPerSecond) {
BenchmarkSuspender suspend;
BucketedTimeSeries<int64_t> ts(numBuckets, duration);
suspend.dismiss();
seconds currentTime(1342000000);
size_t timeCounter = 0;
for (unsigned int n = 0; n < iters; ++n, ++timeCounter) {
if (timeCounter >= callsPerSecond) {
timeCounter = 0;
++currentTime;
}
ts.addValue(currentTime, n);
}
}
示例8: notifySubscribers
void notifySubscribers(uint iters, int N) {
for (uint iter = 0; iter < iters; iter++) {
BenchmarkSuspender bs;
Subject<int> subject;
std::vector<std::unique_ptr<Observer<int>>> observers;
std::vector<Subscription<int>> subscriptions;
subscriptions.reserve(N);
for (int i = 0; i < N; i++) {
observers.push_back(makeObserver());
}
for (int i = 0; i < N; i++) {
subscriptions.push_back(subject.subscribe(std::move(observers[i])));
}
bs.dismiss();
subject.onNext(42);
bs.rehire();
}
}
示例9: subscribeImpl
void subscribeImpl(uint iters, int N, bool countUnsubscribe) {
for (uint iter = 0; iter < iters; iter++) {
BenchmarkSuspender bs;
Subject<int> subject;
std::vector<std::unique_ptr<Observer<int>>> observers;
std::vector<Subscription<int>> subscriptions;
subscriptions.reserve(N);
for (int i = 0; i < N; i++) {
observers.push_back(makeObserver());
}
bs.dismiss();
for (int i = 0; i < N; i++) {
subscriptions.push_back(subject.subscribe(std::move(observers[i])));
}
if (countUnsubscribe) {
subscriptions.clear();
}
bs.rehire();
}
}