Skip to content

Instantly share code, notes, and snippets.

@hampus
Created May 26, 2018 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hampus/d4eed2b7b3c36cde582c55ff8b2fbbb8 to your computer and use it in GitHub Desktop.
Save hampus/d4eed2b7b3c36cde582c55ff8b2fbbb8 to your computer and use it in GitHub Desktop.
Performance micro-benchmarks (2018-05-26)
See https://github.com/hampus/fiberio and examples/fiber_benchmarks.
Run on a single core (using taskset), built with buildtype=release, and with CPU frequency governor set to performance.
bench_echo_one_byte
nanoseconds: 1247600169
seconds: 1.2476
iterations: 100000
per iteration: 12476 ns
iterations per second: 80153
bench_echo_one_byte_ideal_unix_socket_pair
nanoseconds: 180615184
seconds: 0.180615
iterations: 100000
per iteration: 1806 ns
iterations per second: 553663
bench_echo_one_byte_raw_threaded_unix_socket_pair
nanoseconds: 384239429
seconds: 0.384239
iterations: 100000
per iteration: 3842 ns
iterations per second: 260254
bench_fiber_switching
nanoseconds: 1051584148
seconds: 1.05158
iterations: 10000000
per iteration: 105 ns
iterations per second: 9509462
bench_fiber_creation
nanoseconds: 1600867782
seconds: 1.60087
iterations: 5000000
per iteration: 320 ns
iterations per second: 3123306
bench_thread_switching
nanoseconds: 2565307069
seconds: 2.56531
iterations: 2000000
per iteration: 1282 ns
iterations per second: 779633
bench_thread_creation
nanoseconds: 4267661029
seconds: 4.26766
iterations: 500000
per iteration: 8535 ns
iterations per second: 117160
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment