proxygen
|
#include <folly/Synchronized.h>
#include <folly/Benchmark.h>
#include <folly/portability/GTest.h>
#include <algorithm>
#include <condition_variable>
#include <map>
#include <memory>
#include <mutex>
#include <shared_mutex>
#include <thread>
Go to the source code of this file.
Functions | |
DEFINE_uint64 (iterations, 100,"The number of iterations with lock held") | |
BENCHMARK (UncontendedFollyLock, iters) | |
BENCHMARK (UncontendedStdLock, iters) | |
BENCHMARK (UncontendedOrdered, iters) | |
BENCHMARK (UncontendedReverseOrdered, iters) | |
BENCHMARK_DRAW_LINE () | |
BENCHMARK (ThreeThreadsSimpleFollyLock, iters) | |
BENCHMARK (ThreeThreadsSimpleStdLock, iters) | |
BENCHMARK (ThreeThreadsSimpleOrdered, iters) | |
BENCHMARK (ThreeThreadsSimpleReverseOrdered, iters) | |
BENCHMARK (ThreeThreadsPathologicalFollyLock, iters) | |
BENCHMARK (ThreeThreadsPathologicalStdLock, iters) | |
BENCHMARK (ThreeThreadsPathologicalOrdered, iters) | |
BENCHMARK (ThreeThreadsPathologicalCarefullyOrdered, iters) | |
BENCHMARK (TwoThreadsTwoMutexesOrdered, iters) | |
BENCHMARK (TwoThreadsTwoMutexesSmart, iters) | |
BENCHMARK (TwoThreadsTwoMutexesPersistent, iters) | |
BENCHMARK (TwoThreadsFourMutexesOrdered, iters) | |
BENCHMARK (TwoThreadsFourMutexesSmart, iters) | |
BENCHMARK (TwoThreadsFourMutexesPersistent, iters) | |
BENCHMARK (TwoThreadsEightMutexesOrdered, iters) | |
BENCHMARK (TwoThreadsEightMutexesSmart, iters) | |
BENCHMARK (TwoThreadsEightMutexesPersistent, iters) | |
BENCHMARK (TwoThreadsSixteenMutexesOrdered, iters) | |
BENCHMARK (TwoThreadsSixteenMutexesSmart, iters) | |
BENCHMARK (TwoThreadsSixteenMutexesPersistent, iters) | |
BENCHMARK (FourThreadsTwoMutexesOrdered, iters) | |
BENCHMARK (FourThreadsTwoMutexesSmart, iters) | |
BENCHMARK (FourThreadsTwoMutexesPersistent, iters) | |
BENCHMARK (FourThreadsFourMutexesOrdered, iters) | |
BENCHMARK (FourThreadsFourMutexesSmart, iters) | |
BENCHMARK (FourThreadsFourMutexesPersistent, iters) | |
BENCHMARK (FourThreadsEightMutexesOrdered, iters) | |
BENCHMARK (FourThreadsEightMutexesSmart, iters) | |
BENCHMARK (FourThreadsEightMutexesPersistent, iters) | |
BENCHMARK (FourThreadsSixteenMutexesOrdered, iters) | |
BENCHMARK (FourThreadsSixteenMutexesSmart, iters) | |
BENCHMARK (FourThreadsSixteenMutexesPersistent, iters) | |
BENCHMARK (EightThreadsTwoMutexesOrdered, iters) | |
BENCHMARK (EightThreadsTwoMutexesSmart, iters) | |
BENCHMARK (EightThreadsTwoMutexesPersistent, iters) | |
BENCHMARK (EightThreadsFourMutexesOrdered, iters) | |
BENCHMARK (EightThreadsFourMutexesSmart, iters) | |
BENCHMARK (EightThreadsFourMutexesPersistent, iters) | |
BENCHMARK (EightThreadsEightMutexesOrdered, iters) | |
BENCHMARK (EightThreadsEightMutexesSmart, iters) | |
BENCHMARK (EightThreadsEightMutexesPersistent, iters) | |
BENCHMARK (EightThreadsSixteenMutexesOrdered, iters) | |
BENCHMARK (EightThreadsSixteenMutexesSmart, iters) | |
BENCHMARK (EightThreadsSixteenMutexesPersistent, iters) | |
BENCHMARK (SixteenThreadsTwoMutexesOrdered, iters) | |
BENCHMARK (SixteenThreadsTwoMutexesSmart, iters) | |
BENCHMARK (SixteenThreadsTwoMutexesPersistent, iters) | |
BENCHMARK (SixteenThreadsFourMutexesOrdered, iters) | |
BENCHMARK (SixteenThreadsFourMutexesSmart, iters) | |
BENCHMARK (SixteenThreadsFourMutexesPersistent, iters) | |
BENCHMARK (SixteenThreadsEightMutexesOrdered, iters) | |
BENCHMARK (SixteenThreadsEightMutexesSmart, iters) | |
BENCHMARK (SixteenThreadsEightMutexesPersistent, iters) | |
BENCHMARK (SixteenThreadsSixteenMutexesOrdered, iters) | |
BENCHMARK (SixteenThreadsSixteenMutexesSmart, iters) | |
BENCHMARK (SixteenThreadsSixteenMutexesPersistent, iters) | |
int | main (int argc, char **argv) |
BENCHMARK | ( | UncontendedFollyLock | , |
iters | |||
) |
Definition at line 225 of file SynchronizedBenchmark.cpp.
References folly::lock().
BENCHMARK | ( | UncontendedStdLock | , |
iters | |||
) |
Definition at line 229 of file SynchronizedBenchmark.cpp.
References folly::detail::lock().
BENCHMARK | ( | UncontendedOrdered | , |
iters | |||
) |
Definition at line 233 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | UncontendedReverseOrdered | , |
iters | |||
) |
Definition at line 240 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | ThreeThreadsSimpleFollyLock | , |
iters | |||
) |
Definition at line 249 of file SynchronizedBenchmark.cpp.
References folly::lock(), and simple.
BENCHMARK | ( | ThreeThreadsSimpleStdLock | , |
iters | |||
) |
Definition at line 253 of file SynchronizedBenchmark.cpp.
References folly::detail::lock(), and simple.
BENCHMARK | ( | ThreeThreadsSimpleOrdered | , |
iters | |||
) |
BENCHMARK | ( | ThreeThreadsSimpleReverseOrdered | , |
iters | |||
) |
Definition at line 264 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE(), and simple.
BENCHMARK | ( | ThreeThreadsPathologicalFollyLock | , |
iters | |||
) |
Definition at line 273 of file SynchronizedBenchmark.cpp.
References folly::lock().
BENCHMARK | ( | ThreeThreadsPathologicalStdLock | , |
iters | |||
) |
Definition at line 279 of file SynchronizedBenchmark.cpp.
References folly::detail::lock().
BENCHMARK | ( | ThreeThreadsPathologicalOrdered | , |
iters | |||
) |
Definition at line 285 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | ThreeThreadsPathologicalCarefullyOrdered | , |
iters | |||
) |
Definition at line 293 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | TwoThreadsTwoMutexesOrdered | , |
iters | |||
) |
Definition at line 303 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | TwoThreadsTwoMutexesSmart | , |
iters | |||
) |
Definition at line 306 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | TwoThreadsTwoMutexesPersistent | , |
iters | |||
) |
Definition at line 309 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | TwoThreadsFourMutexesOrdered | , |
iters | |||
) |
Definition at line 315 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | TwoThreadsFourMutexesSmart | , |
iters | |||
) |
Definition at line 318 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | TwoThreadsFourMutexesPersistent | , |
iters | |||
) |
Definition at line 321 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | TwoThreadsEightMutexesOrdered | , |
iters | |||
) |
Definition at line 327 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | TwoThreadsEightMutexesSmart | , |
iters | |||
) |
Definition at line 330 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | TwoThreadsEightMutexesPersistent | , |
iters | |||
) |
Definition at line 333 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | TwoThreadsSixteenMutexesOrdered | , |
iters | |||
) |
Definition at line 339 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | TwoThreadsSixteenMutexesSmart | , |
iters | |||
) |
Definition at line 342 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | TwoThreadsSixteenMutexesPersistent | , |
iters | |||
) |
Definition at line 345 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | FourThreadsTwoMutexesOrdered | , |
iters | |||
) |
Definition at line 351 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | FourThreadsTwoMutexesSmart | , |
iters | |||
) |
Definition at line 354 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | FourThreadsTwoMutexesPersistent | , |
iters | |||
) |
Definition at line 357 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | FourThreadsFourMutexesOrdered | , |
iters | |||
) |
Definition at line 363 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | FourThreadsFourMutexesSmart | , |
iters | |||
) |
Definition at line 366 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | FourThreadsFourMutexesPersistent | , |
iters | |||
) |
Definition at line 369 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | FourThreadsEightMutexesOrdered | , |
iters | |||
) |
Definition at line 375 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | FourThreadsEightMutexesSmart | , |
iters | |||
) |
Definition at line 378 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | FourThreadsEightMutexesPersistent | , |
iters | |||
) |
Definition at line 381 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | FourThreadsSixteenMutexesOrdered | , |
iters | |||
) |
Definition at line 387 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | FourThreadsSixteenMutexesSmart | , |
iters | |||
) |
Definition at line 390 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | FourThreadsSixteenMutexesPersistent | , |
iters | |||
) |
Definition at line 393 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | EightThreadsTwoMutexesOrdered | , |
iters | |||
) |
Definition at line 399 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | EightThreadsTwoMutexesSmart | , |
iters | |||
) |
Definition at line 402 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | EightThreadsTwoMutexesPersistent | , |
iters | |||
) |
Definition at line 405 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | EightThreadsFourMutexesOrdered | , |
iters | |||
) |
Definition at line 411 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | EightThreadsFourMutexesSmart | , |
iters | |||
) |
Definition at line 414 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | EightThreadsFourMutexesPersistent | , |
iters | |||
) |
Definition at line 417 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | EightThreadsEightMutexesOrdered | , |
iters | |||
) |
Definition at line 423 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | EightThreadsEightMutexesSmart | , |
iters | |||
) |
Definition at line 426 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | EightThreadsEightMutexesPersistent | , |
iters | |||
) |
Definition at line 429 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | EightThreadsSixteenMutexesOrdered | , |
iters | |||
) |
Definition at line 435 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | EightThreadsSixteenMutexesSmart | , |
iters | |||
) |
Definition at line 438 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | EightThreadsSixteenMutexesPersistent | , |
iters | |||
) |
Definition at line 441 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | SixteenThreadsTwoMutexesOrdered | , |
iters | |||
) |
Definition at line 447 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | SixteenThreadsTwoMutexesSmart | , |
iters | |||
) |
Definition at line 450 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | SixteenThreadsTwoMutexesPersistent | , |
iters | |||
) |
Definition at line 453 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | SixteenThreadsFourMutexesOrdered | , |
iters | |||
) |
Definition at line 459 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | SixteenThreadsFourMutexesSmart | , |
iters | |||
) |
Definition at line 462 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | SixteenThreadsFourMutexesPersistent | , |
iters | |||
) |
Definition at line 465 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | SixteenThreadsEightMutexesOrdered | , |
iters | |||
) |
Definition at line 471 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | SixteenThreadsEightMutexesSmart | , |
iters | |||
) |
Definition at line 474 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | SixteenThreadsEightMutexesPersistent | , |
iters | |||
) |
Definition at line 477 of file SynchronizedBenchmark.cpp.
References folly::BENCHMARK_DRAW_LINE().
BENCHMARK | ( | SixteenThreadsSixteenMutexesOrdered | , |
iters | |||
) |
Definition at line 483 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | SixteenThreadsSixteenMutexesSmart | , |
iters | |||
) |
Definition at line 486 of file SynchronizedBenchmark.cpp.
BENCHMARK | ( | SixteenThreadsSixteenMutexesPersistent | , |
iters | |||
) |
Definition at line 489 of file SynchronizedBenchmark.cpp.
BENCHMARK_DRAW_LINE | ( | ) |
DEFINE_uint64 | ( | iterations | , |
100 | , | ||
"The number of iterations with lock held" | |||
) |
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 493 of file SynchronizedBenchmark.cpp.
References folly::doNotOptimizeAway(), i, mutex, folly::runBenchmarks(), simple, folly::detail::distributed_mutex::spin(), folly::f14::swap(), threads, and folly::fibers::yield().