| Home | Libraries | People | FAQ | More

## Performance

Performance measurements were taken using `std::chrono::highresolution_clock`, with overhead corrections. The code was compiled using the build options: variant = release, optimization = speed [7].

The columns labeled fiber (atomics) were compiled with default fiber synchronization, capable of synchronizing fibers running on different threads. The columns labeled fiber (raw) were compiled with `BOOST_FIBERS_NO_ATOMICS`.

Table 1.1. Overhead of join (contains fiber-context destruction, fiber-stack deallocation)

thread | fiber (atomics) | fiber (raw) | tbb | qthread
--- | --- | --- | --- | ---
18 µs | 950 ns | 900 ns | 570 ns | 620 ns

(from overhead_join.cpp)

Table 1.2. Overhead of detach

thread | fiber (atomics) | fiber (raw)
--- | --- | ---
126 ns | 21 ns | 20 ns

(from overhead_detach.cpp)

Table 1.3. Overhead of yield

thread | fiber (atomics) | fiber (raw)
--- | --- | ---
1.5 µs | 310 ns | 330 ns

(from overhead_yield.cpp)

Table 1.4. Overhead of waiting on a future

thread | fiber (atomics) | fiber (raw)
--- | --- | ---
16 µs | 1.40 µs | 1.38 µs

(from overhead_future.cpp)

Table 1.5. Overhead of fiber creation (contains fiber-stack allocation and preparation, fiber-context construction, scheduler handling)

thread | fiber (atomics) | fiber (raw)
--- | --- | ---
18 µs | 450 ns | 445 ns

(from overhead_create.cpp)

Table 1.6. Scaling of creating and joining

average of | thread | fiber (atomics) | fiber (raw)
--- | --- | --- | ---
10 | 8.21 µs | 1.96 µs | 1.85 µs
50 | 6.67 µs | 1.40 µs | 1.27 µs
100 | 6.79 µs | 1.84 µs | 1.81 µs
500 | 8.25 µs | 1.13 µs | 1.10 µs
1000 | 7.71 µs | 1.46 µs | 1.26 µs
5000 | 5.67 µs | 2.11 µs | 1.90 µs
10000 | 5.25 µs | 2.36 µs | 1.89 µs

(from scale_join.cpp)

Numbers of the microbenchmark syknet from Alexander Temerev [8]:

Table 1.7. performance of N=100000 actors/goroutines/fibers

Haskell | stack-1.0.4 | fiber (single threaded/raw) | gcc-5.2.1 | fiber (single threaded/atomics) | gcc-5.2.1 | Erlang | erts-7.0 | Go | go1.4.2
--- | --- | --- | --- | ---
58ms - 108ms | 205ms - 263ms | 221ms - 278ms | 237ms- 470ms | 614ms - 883ms

[7] Intel Core2 Q6700, x86_64, 3GHz

[8] Intel Core2 Q6700, x86_64, 3GHz