projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Expose move result from LockFreeRingBuffer::Cursor
[folly.git]
/
folly
/
test
/
ConcurrentSkipListBenchmark.cpp
diff --git
a/folly/test/ConcurrentSkipListBenchmark.cpp
b/folly/test/ConcurrentSkipListBenchmark.cpp
index c05bda736c3526dfcb95481ab58fd324e2af0c13..fa5437c0e99e5e89e2e5b1b3e33bced1f3d24e5f 100644
(file)
--- a/
folly/test/ConcurrentSkipListBenchmark.cpp
+++ b/
folly/test/ConcurrentSkipListBenchmark.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 201
3
Facebook, Inc.
+ * Copyright 201
5
Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-22,10
+22,10
@@
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gflags/gflags.h>
#include <glog/logging.h>
-#include
"folly/Benchmark.h"
-#include
"folly/ConcurrentSkipList.h"
-#include
"folly/Hash.h"
-#include
"folly/RWSpinLock.h"
+#include
<folly/Benchmark.h>
+#include
<folly/ConcurrentSkipList.h>
+#include
<folly/Hash.h>
+#include
<folly/RWSpinLock.h>
DEFINE_int32(num_threads, 12, "num concurrent threads to test");
DEFINE_int32(num_threads, 12, "num concurrent threads to test");
@@
-302,7
+302,7
@@
BENCHMARK(Accessor, iters) {
auto sl = skiplist.get();
susp.dismiss();
auto sl = skiplist.get();
susp.dismiss();
- for (
in
t i = 0; i < iters; ++i) {
+ for (
size_
t i = 0; i < iters; ++i) {
SkipListAccessor accessor(sl);
}
}
SkipListAccessor accessor(sl);
}
}
@@
-318,7
+318,7
@@
BENCHMARK(accessorBasicRefcounting, iters) {
l.init();
susp.dismiss();
l.init();
susp.dismiss();
- for (
in
t i = 0; i < iters; ++i) {
+ for (
size_
t i = 0; i < iters; ++i) {
value->fetch_add(1, std::memory_order_relaxed);
if (dirty->load(std::memory_order_acquire) != 0) {
folly::MSLGuard g(l);
value->fetch_add(1, std::memory_order_relaxed);
if (dirty->load(std::memory_order_acquire) != 0) {
folly::MSLGuard g(l);
@@
-407,23
+407,23
@@
class ConcurrentAccessData {
sets_[idx].erase(val);
}
sets_[idx].erase(val);
}
- void runSkipList(int id,
in
t iters) {
+ void runSkipList(int id,
size_
t iters) {
int sum = 0;
int sum = 0;
- for (
in
t i = 0; i < iters; ++i) {
+ for (
size_
t i = 0; i < iters; ++i) {
sum += accessSkipList(id, i);
}
// VLOG(20) << sum;
}
sum += accessSkipList(id, i);
}
// VLOG(20) << sum;
}
- void runSet(
int id, in
t iters) {
+ void runSet(
size_t id, size_
t iters) {
int sum = 0;
int sum = 0;
- for (
in
t i = 0; i < iters; ++i) {
+ for (
size_
t i = 0; i < iters; ++i) {
sum += accessSet(id, i);
}
// VLOG(20) << sum;
}
sum += accessSet(id, i);
}
// VLOG(20) << sum;
}
- bool accessSkipList(int64_t id,
in
t t) {
+ bool accessSkipList(int64_t id,
size_
t t) {
if (t > readValues_.size()) {
t = t % readValues_.size();
}
if (t > readValues_.size()) {
t = t % readValues_.size();
}
@@
-441,7
+441,7
@@
class ConcurrentAccessData {
}
}
}
}
- bool accessSet(int64_t id,
in
t t) {
+ bool accessSet(int64_t id,
size_
t t) {
if (t > readValues_.size()) {
t = t % readValues_.size();
}
if (t > readValues_.size()) {
t = t % readValues_.size();
}
@@
-599,7
+599,7
@@
BENCHMARK_DRAW_LINE();
int main(int argc, char** argv) {
google::InitGoogleLogging(argv[0]);
int main(int argc, char** argv) {
google::InitGoogleLogging(argv[0]);
- g
oogle
::ParseCommandLineFlags(&argc, &argv, true);
+ g
flags
::ParseCommandLineFlags(&argc, &argv, true);
initData();
runBenchmarks();
initData();
runBenchmarks();