mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-21 02:52:18 +00:00
585 lines
15 KiB
HTML
585 lines
15 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
<title>Performance</title>
|
|
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
|
<link rel="home" href="../index.html" title="Chapter 1. Fiber">
|
|
<link rel="up" href="../index.html" title="Chapter 1. Fiber">
|
|
<link rel="prev" href="integration/deeper_dive_into___boost_asio__.html" title="Deeper Dive into Boost.Asio">
|
|
<link rel="next" href="custom.html" title="Customization">
|
|
</head>
|
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
<table cellpadding="2" width="100%"><tr>
|
|
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
|
|
<td align="center"><a href="../../../../../index.html">Home</a></td>
|
|
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
|
|
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
|
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
|
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="integration/deeper_dive_into___boost_asio__.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="custom.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
|
<a name="fiber.performance"></a><a class="link" href="performance.html" title="Performance">Performance</a>
|
|
</h2></div></div></div>
|
|
<p>
|
|
Performance measurements were taken using <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">highresolution_clock</span></code>,
|
|
with overhead corrections. The code was compiled using the build options: variant
|
|
= release, optimization = speed <sup>[<a name="fiber.performance.f0" href="#ftn.fiber.performance.f0" class="footnote">7</a>]</sup>.
|
|
</p>
|
|
<p>
|
|
The columns labeled <span class="bold"><strong>fiber (atomics)</strong></span> were compiled
|
|
with default fiber synchronization, capable of synchronizing fibers running
|
|
on different threads. The columns labeled <span class="bold"><strong>fiber (raw)</strong></span>
|
|
were compiled with <a class="link" href="overview.html#cross_thread_sync"><code class="computeroutput"><span class="identifier">BOOST_FIBERS_NO_ATOMICS</span></code></a>.
|
|
</p>
|
|
<div class="table">
|
|
<a name="fiber.performance.overhead_of_join__contains_fiber_context_destruction__fiber_stack_deallocation_"></a><p class="title"><b>Table 1.1. Overhead of join (contains fiber-context destruction, fiber-stack deallocation)</b></p>
|
|
<div class="table-contents"><table class="table" summary="Overhead of join (contains fiber-context destruction, fiber-stack deallocation)">
|
|
<colgroup>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
</colgroup>
|
|
<thead><tr>
|
|
<th>
|
|
<p>
|
|
thread
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (atomics)
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (raw)
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
tbb
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
qthread
|
|
</p>
|
|
</th>
|
|
</tr></thead>
|
|
<tbody><tr>
|
|
<td>
|
|
<p>
|
|
18 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
950 ns
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
900 ns
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
570 ns
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
620 ns
|
|
</p>
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
<br class="table-break"><p>
|
|
(from <a href="../../../performance/fiber/overhead_join.cpp" target="_top">overhead_join.cpp</a>)
|
|
</p>
|
|
<div class="table">
|
|
<a name="fiber.performance.overhead_of_detach"></a><p class="title"><b>Table 1.2. Overhead of detach</b></p>
|
|
<div class="table-contents"><table class="table" summary="Overhead of detach">
|
|
<colgroup>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
</colgroup>
|
|
<thead><tr>
|
|
<th>
|
|
<p>
|
|
thread
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (atomics)
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (raw)
|
|
</p>
|
|
</th>
|
|
</tr></thead>
|
|
<tbody><tr>
|
|
<td>
|
|
<p>
|
|
126 ns
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
21 ns
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
20 ns
|
|
</p>
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
<br class="table-break"><p>
|
|
(from <a href="../../../performance/fiber/overhead_detach.cpp" target="_top">overhead_detach.cpp</a>)
|
|
</p>
|
|
<div class="table">
|
|
<a name="fiber.performance.overhead_of_yield"></a><p class="title"><b>Table 1.3. Overhead of yield</b></p>
|
|
<div class="table-contents"><table class="table" summary="Overhead of yield">
|
|
<colgroup>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
</colgroup>
|
|
<thead><tr>
|
|
<th>
|
|
<p>
|
|
thread
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (atomics)
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (raw)
|
|
</p>
|
|
</th>
|
|
</tr></thead>
|
|
<tbody><tr>
|
|
<td>
|
|
<p>
|
|
1.5 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
310 ns
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
330 ns
|
|
</p>
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
<br class="table-break"><p>
|
|
(from <a href="../../../performance/fiber/overhead_yield.cpp" target="_top">overhead_yield.cpp</a>)
|
|
</p>
|
|
<div class="table">
|
|
<a name="fiber.performance.overhead_of_waiting_on_a_future"></a><p class="title"><b>Table 1.4. Overhead of waiting on a future</b></p>
|
|
<div class="table-contents"><table class="table" summary="Overhead of waiting on a future">
|
|
<colgroup>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
</colgroup>
|
|
<thead><tr>
|
|
<th>
|
|
<p>
|
|
thread
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (atomics)
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (raw)
|
|
</p>
|
|
</th>
|
|
</tr></thead>
|
|
<tbody><tr>
|
|
<td>
|
|
<p>
|
|
16 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.40 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.38 µs
|
|
</p>
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
<br class="table-break"><p>
|
|
(from <a href="../../../performance/fiber/overhead_future.cpp" target="_top">overhead_future.cpp</a>)
|
|
</p>
|
|
<div class="table">
|
|
<a name="fiber.performance.overhead_of_fiber_creation__contains_fiber_stack_allocation_and_preparation__fiber_context_construction__scheduler_handling_"></a><p class="title"><b>Table 1.5. Overhead of fiber creation (contains fiber-stack allocation and preparation,
|
|
fiber-context construction, scheduler handling)</b></p>
|
|
<div class="table-contents"><table class="table" summary="Overhead of fiber creation (contains fiber-stack allocation and preparation,
|
|
fiber-context construction, scheduler handling)">
|
|
<colgroup>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
</colgroup>
|
|
<thead><tr>
|
|
<th>
|
|
<p>
|
|
thread
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (atomics)
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (raw)
|
|
</p>
|
|
</th>
|
|
</tr></thead>
|
|
<tbody><tr>
|
|
<td>
|
|
<p>
|
|
18 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
450 ns
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
445 ns
|
|
</p>
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
<br class="table-break"><p>
|
|
(from <a href="../../../performance/fiber/overhead_create.cpp" target="_top">overhead_create.cpp</a>)
|
|
</p>
|
|
<div class="table">
|
|
<a name="fiber.performance.scaling_of_creating_and_joining"></a><p class="title"><b>Table 1.6. Scaling of creating and joining</b></p>
|
|
<div class="table-contents"><table class="table" summary="Scaling of creating and joining">
|
|
<colgroup>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
</colgroup>
|
|
<thead><tr>
|
|
<th>
|
|
<p>
|
|
average of
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
thread
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (atomics)
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (raw)
|
|
</p>
|
|
</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
10
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
8.21 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.96 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.85 µs
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
50
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
6.67 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.40 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.27 µs
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
100
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
6.79 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.84 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.81 µs
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
500
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
8.25 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.13 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.10 µs
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
1000
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
7.71 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.46 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.26 µs
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
5000
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
5.67 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
2.11 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.90 µs
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
10000
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
5.25 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
2.36 µs
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
1.89 µs
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<br class="table-break"><p>
|
|
(from <a href="../../../performance/fiber/scale_join.cpp" target="_top">scale_join.cpp</a>)
|
|
</p>
|
|
<p>
|
|
Numbers of the <a href="https://github.com/atemerev/skynet" target="_top">microbenchmark
|
|
<span class="emphasis"><em>syknet</em></span></a> from Alexander Temerev <sup>[<a name="fiber.performance.f1" href="#ftn.fiber.performance.f1" class="footnote">8</a>]</sup>:
|
|
</p>
|
|
<div class="table">
|
|
<a name="fiber.performance.performance_of_n_100000_actors_goroutines_fibers"></a><p class="title"><b>Table 1.7. performance of N=100000 actors/goroutines/fibers</b></p>
|
|
<div class="table-contents"><table class="table" summary="performance of N=100000 actors/goroutines/fibers">
|
|
<colgroup>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
</colgroup>
|
|
<thead><tr>
|
|
<th>
|
|
<p>
|
|
Haskell | stack-1.0.4
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (single threaded/raw) | gcc-5.2.1
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
fiber (single threaded/atomics) | gcc-5.2.1
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
Erlang | erts-7.0
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
Go | go1.4.2
|
|
</p>
|
|
</th>
|
|
</tr></thead>
|
|
<tbody><tr>
|
|
<td>
|
|
<p>
|
|
58ms - 108ms
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
205ms - 263ms
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
221ms - 278ms
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
237ms- 470ms
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
614ms - 883ms
|
|
</p>
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
<br class="table-break"><div class="footnotes">
|
|
<br><hr width="100" align="left">
|
|
<div class="footnote"><p><sup>[<a name="ftn.fiber.performance.f0" href="#fiber.performance.f0" class="para">7</a>] </sup>
|
|
Intel Core2 Q6700, x86_64, 3GHz
|
|
</p></div>
|
|
<div class="footnote"><p><sup>[<a name="ftn.fiber.performance.f1" href="#fiber.performance.f1" class="para">8</a>] </sup>
|
|
Intel Core2 Q6700, x86_64, 3GHz
|
|
</p></div>
|
|
</div>
|
|
</div>
|
|
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
|
<td align="left"></td>
|
|
<td align="right"><div class="copyright-footer">Copyright © 2013 Oliver Kowalke<p>
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
|
</p>
|
|
</div></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="integration/deeper_dive_into___boost_asio__.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="custom.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
|
|
</div>
|
|
</body>
|
|
</html>
|