foundationdb/flow/bench
Pierce Lopez 939f0a587c
delete flow/CompressionUtils and zstd support (#13708)
This was only used by the "blog granule" feature which was
removed in #12435 / b1d6dcf0e7
2026-07-15 23:26:13 -04:00
..
BenchActorCollection.cpp Clarify ActorCollection benchmark arguments 2026-07-10 05:28:38 -07:00
BenchAsyncResult.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchCallback.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchCallbackActor.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchConflictSet.cpp Decompose flowbench 2026-03-28 23:38:33 +00:00
BenchCoroChooseRace.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchCoroutineOverhead.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchHash.cpp Decompose flowbench 2026-03-28 23:38:33 +00:00
BenchMain.cpp Add BenchMain.h header file 2026-03-29 00:41:48 +00:00
BenchMem.cpp Decompose flowbench 2026-03-28 23:38:33 +00:00
BenchMemcpy.cpp Replace test_memcpy_perf.cpp using micobenchmark framework 2026-04-20 17:55:49 +00:00
BenchNet2.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchNet2Actor.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchNoThrowOnCancel.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchPriorityMultiLock.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchRandom.cpp Decompose flowbench 2026-03-28 23:38:33 +00:00
BenchRef.cpp Decompose flowbench 2026-03-28 23:38:33 +00:00
BenchStream.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchSupport.h Decompose flowbench 2026-03-28 23:38:33 +00:00
BenchThreadHelper.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchTimeout.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
BenchTimer.cpp Decompose flowbench 2026-03-28 23:38:33 +00:00
BenchWaitForAllReady.cpp Rename ThreadHelper.actor.h 2026-06-21 01:58:26 -07:00
CMakeLists.txt delete flow/CompressionUtils and zstd support (#13708) 2026-07-15 23:26:13 -04:00
README.md Replace test_memcpy_perf.cpp using micobenchmark framework 2026-04-20 17:55:49 +00:00

README.md

Summary

The benchmark suite is split into three executables:

  • flow_bench for benchmarks that depend only on flow
  • fdbrpc_bench for benchmarks that depend on fdbrpc
  • fdbclient_bench for benchmarks that depend on fdbclient

These binaries can be used to microbenchmark parts of the FoundationDB code without always pulling in higher-level dependencies. Specifically, they can be used to:

  • Test the performance effects of changes to the actor compiler or to the flow and fdbrpc libraries
  • Test the performance of various uses of the flow and fdbrpc libraries
  • Find areas for improvement in the flow and fdbrpc libraries
  • Compare flow/fdbrpc primitives to alternatives provided by the standard library or other third-party libraries.

Usage

  • To build one of the benchmark executables, run ninja flow_bench, ninja fdbrpc_bench, or ninja fdbclient_bench.
  • Then you can run bin/<target> --help to see possible uses of that benchmark binary.
  • Running bin/<target> directly will run all registered benchmarks in that binary, but you may want to limit your run to a subset of benchmarks. This can be done by running bin/<target> --benchmark_filter=<regex>
  • All benchmark names can be listed with bin/<target> --benchmark_list_tests
  • Example output:
$ bin/flow_bench --benchmark_filter=bench_ref
2020-08-04 21:49:40
Running bin/flow_bench
Run on (7 X 2904 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x7)
  L1 Instruction 32 KiB (x7)
  L2 Unified 256 KiB (x7)
  L3 Unified 12288 KiB (x1)
Load Average: 0.15, 0.15, 0.72
---------------------------------------------------------------------------------------------------------------
Benchmark                                                     Time             CPU   Iterations UserCounters...
---------------------------------------------------------------------------------------------------------------
bench_ref_create_and_destroy<RefType::RawPointer>          4.90 ns         4.90 ns    116822124 items_per_second=203.88M/s
bench_ref_create_and_destroy<RefType::UniquePointer>       4.94 ns         4.94 ns    141101924 items_per_second=202.555M/s
bench_ref_create_and_destroy<RefType::SharedPointer>       42.5 ns         42.5 ns     13802909 items_per_second=23.531M/s
bench_ref_create_and_destroy<RefType::FlowReference>       5.05 ns         5.05 ns    100000000 items_per_second=197.955M/s
bench_ref_copy<RefType::RawPointer>                        1.15 ns         1.15 ns    612121585 items_per_second=871.218M/s
bench_ref_copy<RefType::SharedPointer>                     10.0 ns         10.0 ns     67553102 items_per_second=99.8113M/s
bench_ref_copy<RefType::FlowReference>                     2.33 ns         2.33 ns    292317474 items_per_second=428.507M/s

Existing Benchmarks

  • bench_populate measures the population of a vector of mutations
  • bench_ref compares the performance of the flow Reference type to other pointer types
  • bench_iterate measures iteration over a list of mutations
  • bench_stream measures the performance of writing to and reading from a PromiseStream
  • bench_random measures the performance of DeterministicRandom.
  • bench_timer measures the performance of FoundationDB timers.
  • Memcpy compares rte_memcpy_noinline and memcpy across aligned/unaligned and cached/uncached copy cases.

Future use cases

  • Benchmark the overhead of sending and receiving messages through FlowTransport
  • Benchmark the performance of serializing/deserializing various types