#!/bin/bash -e
-Benchmarks=(stress-sequential-folly-map)
+Benchmarks=(
+ stress-sequential-folly-queue
+ stress-sequential-folly-map
+ stress-sequential-folly-sync
+)
for bench in ${Benchmarks[*]}; do
rm -rf $bench ${bench}.bc ${bench}.o
typedef folly::RWTicketSpinLock64 RWTicketSpinLock64;
// RCU
-const size_t kRcuSyncPassCount = 3000000;
-const size_t kRcuNoSyncPassCount = 2500000;
+const size_t kRcuSyncPassCount = 180000;
+const size_t kRcuNoSyncPassCount = 3500000;
const char* kRcuSyncBenchmarkName = "FollyRCU_Sync";
const char* kRcuNoSyncBenchmarkName = "FollyRCU_NoSync";
// Represent the RCU-protected data.
std::cout << "[ RUN ] " << kTestName << "." << bench_name << std::endl;
auto start_time = std::chrono::system_clock::now();
- for (size_t count = 0; count < pass_count; count++) {
- RcuFoo* f = new RcuFoo();
- folly::rcu_retire(f);
- folly::synchronize_rcu();
+ for (int write_percentage = 1; write_percentage <= 5; write_percentage += 1) {
+ for (size_t count = 0; count < pass_count; count++) {
+ for (int i = 0; i < 100; ++i) {
+ if (i < write_percentage) {
+ RcuFoo* f = new RcuFoo();
+ folly::rcu_retire(f);
+ folly::synchronize_rcu();
+ } else {
+ folly::rcu_reader g;
+ }
+ }
+ }
}
auto finish_time = std::chrono::system_clock::now();
std::cout << "[ RUN ] " << kTestName << "." << bench_name << std::endl;
auto start_time = std::chrono::system_clock::now();
- for (int write_percentage = 5; write_percentage <= 10; write_percentage += 1) {
+ for (int write_percentage = 1; write_percentage <= 5; write_percentage += 1) {
for (size_t count = 0; count < pass_count; count++) {
for (int i = 0; i < 100; ++i) {
if (i < write_percentage) {