[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -0,0 +1,72 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Acknowledgments</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../poly_collection.html" title="Chapter 29. Boost.PolyCollection">
<link rel="prev" href="release_notes.html" title="Release notes">
<link rel="next" href="../process.html" title="Chapter 30. Boost.Process">
</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="release_notes.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="../process.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="poly_collection.acknowledgments"></a><a class="link" href="acknowledgments.html" title="Acknowledgments">Acknowledgments</a>
</h2></div></div></div>
<p>
The library uses <a href="http://www.pdimov.com/" target="_top">Peter Dimov</a>'s
<a href="http://www.pdimov.com/cpp2/simple_cxx11_metaprogramming.html" target="_top">implementation
of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">make_index_sequence</span></code></a>. <a href="http://manu343726.github.io/" target="_top">Manu
Sánchez</a> aided immensely with CI setup and performance testing. <a href="http://stackoverflow.com/users/85371/sehe" target="_top">Sehe</a> contributed performance
results for GCC 5.2, and <a href="https://www.linkedin.com/in/francisco-jose-tapia-iba%C3%B1ez-4239a07a" target="_top">Francisco
José Tapia</a> for Clang 3.9.
</p>
<p>
The Boost acceptance review took place between the 3rd and 17th of May, 2017.
Thank you to Ion Gaztañaga for smoothly managing the process. The following
people participated with full reviews or valuable comments: Pete Bartlett,
Hans Dembinski, Dominique Devienne, Edward Diener, Vinnie Falco, Ion Gaztañaga,
Andrzej Krzemienski, Brook Milligan, Thorsten Ottosen, Steven Watanabe, Adam
Wulkiewicz. Many thanks to all of them. Steven Watanabe gave crucial help in
solving some hard problems related to the usage of <a href="../../../libs/type_erasure" target="_top">Boost.TypeErasure</a>.
</p>
<p>
Boost.PolyCollection was designed and written between rainy <a href="https://es.wikipedia.org/wiki/Viav%C3%A9lez" target="_top">Viavélez</a>,
noisy Madrid and beautiful <a href="https://en.wikipedia.org/wiki/C%C3%A1ceres%2c_Spain" target="_top">Cáceres</a>,
August-November, 2016. Most of the after-review work in preparation for the
official Boost release was done in the quiet town of <a href="https://es.wikipedia.org/wiki/Oropesa_(Toledo)" target="_top">Oropesa</a>
during the spring of 2017.
</p>
<p>
In memory of Joaquín López Borrella (1939-2015), in memory of Héctor (2004-2017):
may your ghosts keep us company.
</p>
</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 © 2016-2021 Joaquín M López Muñoz<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="release_notes.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="../process.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,162 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>An efficient polymorphic data structure</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../poly_collection.html" title="Chapter 29. Boost.PolyCollection">
<link rel="prev" href="../poly_collection.html" title="Chapter 29. Boost.PolyCollection">
<link rel="next" href="tutorial.html" title="Tutorial">
</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="../poly_collection.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="tutorial.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="poly_collection.an_efficient_polymorphic_data_st"></a><a class="link" href="an_efficient_polymorphic_data_st.html" title="An efficient polymorphic data structure">An efficient
polymorphic data structure</a>
</h2></div></div></div>
<p>
Suppose we have a <code class="computeroutput"><span class="identifier">base</span></code> abstract
class with implementations <code class="computeroutput"><span class="identifier">derived1</span></code>,
<code class="computeroutput"><span class="identifier">derived2</span></code> and <code class="computeroutput"><span class="identifier">derived3</span></code>. The memory layout of a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">base</span><span class="special">*&gt;</span></code> (or similar constructs such as <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">unique_ptr</span><span class="special">&lt;</span><span class="identifier">base</span><span class="special">&gt;&gt;</span></code>
or <a href="../../../libs/ptr_container/" target="_top"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ptr_vector</span><span class="special">&lt;</span><span class="identifier">base</span><span class="special">&gt;</span></code></a>) looks like the following:
</p>
<p>
<span class="inlinemediaobject"><img src="img/ptr_vector.png"></span>
</p>
<p>
Elements that are adjacent in the vector are not necessarily allocated contiguously,
much less so if the vector has undergone mid insertions and deletions. A typical
processing operation
</p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">base</span><span class="special">*&gt;</span> <span class="identifier">v</span><span class="special">;</span>
<span class="special">...</span>
<span class="keyword">for</span><span class="special">(</span><span class="identifier">base</span><span class="special">*</span> <span class="identifier">b</span><span class="special">:</span> <span class="identifier">v</span><span class="special">){</span>
<span class="special">...</span> <span class="comment">// access base's virtual interface</span>
<span class="special">}</span>
</pre>
<p>
is impacted negatively by two factors:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Scattering of elements throughout memory reduces CPU caching efficiency,
which in general favor regular access loops to contiguous memory areas.
</li>
<li class="listitem">
<a href="https://en.wikipedia.org/wiki/Branch_predictor" target="_top">Branch prediction</a>
tries to minimize the effect of running conditional code (such as an <code class="computeroutput"><span class="keyword">if</span></code>-<code class="computeroutput"><span class="keyword">else</span></code>
statement or the invocation of a <code class="computeroutput"><span class="identifier">base</span></code>
virtual function) by speculatively executing a given branch based on past
history. This mechanism is rendered mostly useless when <code class="computeroutput"><span class="identifier">derived1</span></code>,
<code class="computeroutput"><span class="identifier">derived2</span></code> and <code class="computeroutput"><span class="identifier">derived3</span></code> elements are interspersed along
the sequence without a definite pattern.
</li>
</ul></div>
<p>
These limitations are imposed by the very nature of dynamic polymorphism: as
the exact types of the elements accessed through <code class="computeroutput"><span class="identifier">base</span></code>'s
interface are not known, an indirection through <code class="computeroutput"><span class="identifier">base</span><span class="special">*</span></code> (a particular form of <span class="emphasis"><em>type erasure</em></span>)
is required. There is however a critical observation: even though derived types
are not known when traversing a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">base</span><span class="special">*&gt;</span></code>, the information is typically available
<span class="emphasis"><em>at compile time</em></span> at the point of insertion in the vector:
</p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">base</span><span class="special">*&gt;</span> <span class="identifier">v</span><span class="special">;</span>
<span class="special">...</span>
<span class="identifier">v</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">derived2</span><span class="special">{...});</span> <span class="comment">// the type derived2 is "forgotten" by v</span>
</pre>
<p>
A suitably designed container can take advantage of this information to arrange
elements contiguously according to their exact type, which results in an internal
data structure (a map of pointers to <a href="http://en.cppreference.com/w/cpp/types/type_info" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">type_info</span></code></a>
objects, actually) pointing to as many vectors or <span class="emphasis"><em>segments</em></span>
as there are derived classes:
</p>
<p>
<span class="inlinemediaobject"><img src="img/segment_map.png"></span>
</p>
<p>
Traversing such a structure reduces to looping over all the segments one after
another: this is extremely efficient both in terms of caching and branch prediction.
In the process we have however lost the free-order capability of a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">base</span><span class="special">*&gt;</span></code> (free order can only be retained at the
segment level), but if this is not relevant to the user application the potential
performance gains of switching to this structure are large.
</p>
<p>
The discussion has focused on base/derived programming, also known as OOP,
but it also applies to other forms of dynamic polymorphism:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<a href="http://en.cppreference.com/w/cpp/utility/functional/function" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">function</span></code></a> abstracts callable entities
with the same given signature under a common interface. Internally, pointer
indirections and virtual-like function calls are used. Memory fragmentation
is expected to be lower than with OOP, though, as implementations usually
feature the so-called <a href="http://talesofcpp.fusionfenix.com/post-16/episode-nine-erasing-the-concrete#a-note-on-small-buffer-optimization" target="_top"><span class="emphasis"><em>small
buffer optimization</em></span></a> to avoid heap allocation in some
situations.
</li>
<li class="listitem">
The case of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">function</span></code> can be seen as a particular
example of a more general form of polymorphism called <a href="https://en.wikipedia.org/wiki/Duck_typing" target="_top"><span class="emphasis"><em>duck
typing</em></span></a>, where unrelated types are treated uniformly
if they conform to the same given <span class="emphasis"><em>interface</em></span> (a specified
set of member functions and/or operations). Duck typing provides the power
of OOP while allowing for greater flexibility as polymorphic types need
not derive from a preexisting base class or in general be designed with
any particular interface in mind --in fact, the same object can be duck-typed
to different interfaces. Among other libraries, <a href="../../../libs/type_erasure" target="_top">Boost.TypeErasure</a>
provides duck typing for C++. Under the hood, duck typing requires pointer
indirection and virtual call implementation techniques analogous to those
of OOP, and so there are the same opportunities for efficient container
data structures as we have described.
</li>
</ul></div>
<p>
Boost.PolyCollection provides three different container class templates dealing
with OOP, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">function</span></code>-like polymorphism and duck typing
as implemented by Boost.TypeErasure:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span></code>
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_collection</span></code>
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span></code>
</li>
</ul></div>
<p>
The interfaces of these containers are mostly the same and follow the usual
conventions of standard library containers.
</p>
</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 © 2016-2021 Joaquín M López Muñoz<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="../poly_collection.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="tutorial.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Future work</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../poly_collection.html" title="Chapter 29. Boost.PolyCollection">
<link rel="prev" href="reference.html" title="Reference">
<link rel="next" href="release_notes.html" title="Release notes">
</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="reference.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="release_notes.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="poly_collection.future_work"></a><a class="link" href="future_work.html" title="Future work">Future work</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="future_work.html#poly_collection.future_work.alternative_rtti_systems">Alternative
RTTI systems</a></span></dt>
<dt><span class="section"><a href="future_work.html#poly_collection.future_work.copy_traits">Copy traits</a></span></dt>
<dt><span class="section"><a href="future_work.html#poly_collection.future_work.parallel_algorithms">Parallel
algorithms</a></span></dt>
<dt><span class="section"><a href="future_work.html#poly_collection.future_work.variant_collection"><code class="computeroutput"><span class="identifier">variant_collection</span></code></a></span></dt>
<dt><span class="section"><a href="future_work.html#poly_collection.future_work.ordered_polymorphic_collections">Ordered
polymorphic collections</a></span></dt>
</dl></div>
<p>
A number of features asked by reviewers and users of Boost.PolyCollection are
considered for inclusion into future versions of the library.
</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.future_work.alternative_rtti_systems"></a><a class="link" href="future_work.html#poly_collection.future_work.alternative_rtti_systems" title="Alternative RTTI systems">Alternative
RTTI systems</a>
</h3></div></div></div>
<p>
Boost.PolyCollection can be extended to use <a href="../../../libs/type_index" target="_top">Boost.TypeIndex</a>
in RTTI-challenged scenarios. Taking this idea further, it is not unusual
that some environments (game engines, for instance) provide their own RTTI
framework: an even more ambitious extension to Boost.PolyCollection would
then be to make it configurable for user-provided RTTI through some sort
of traits class specifying replacements for <a href="http://en.cppreference.com/w/cpp/types/type_info" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">type_info</span></code></a>
and <a href="http://en.cppreference.com/w/cpp/language/typeid" target="_top"><code class="computeroutput"><span class="keyword">typeid</span></code></a>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.future_work.copy_traits"></a><a class="link" href="future_work.html#poly_collection.future_work.copy_traits" title="Copy traits">Copy traits</a>
</h3></div></div></div>
<p>
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span></code> requires that stored objects
be <a href="http://en.cppreference.com/w/cpp/named_req/MoveConstructible" target="_top"><span class="bold"><strong><code class="computeroutput"><span class="identifier">MoveConstructible</span></code></strong></span></a>
and <a href="http://en.cppreference.com/w/cpp/named_req/MoveAssignable" target="_top"><span class="bold"><strong><code class="computeroutput"><span class="identifier">MoveAssignable</span></code></strong></span></a>;
unfortunately, it is customary to restrict copying in OOP hierarchies to
avoid slicing, which would force users to revisit their class definitions
in order to use Boost.PolyCollection. This can be alleviated by offering
a configurable traits class where copy and assignment can be defined externally
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">struct</span> <span class="identifier">copy_traits</span>
<span class="special">{</span>
<span class="keyword">void</span> <span class="identifier">construct</span><span class="special">(</span><span class="keyword">void</span><span class="special">*,</span><span class="identifier">T</span><span class="special">&amp;&amp;);</span>
<span class="keyword">void</span> <span class="identifier">assign</span><span class="special">(</span><span class="identifier">T</span><span class="special">&amp;,</span><span class="identifier">T</span><span class="special">&amp;&amp;);</span>
<span class="special">};</span>
</pre>
<p>
with default implementations resorting to regular placement <code class="computeroutput"><span class="keyword">new</span></code> and <code class="computeroutput"><span class="identifier">T</span><span class="special">::</span><span class="keyword">operator</span><span class="special">=</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.future_work.parallel_algorithms"></a><a class="link" href="future_work.html#poly_collection.future_work.parallel_algorithms" title="Parallel algorithms">Parallel
algorithms</a>
</h3></div></div></div>
<p>
C++17 introduces <a href="http://en.cppreference.com/w/cpp/experimental/parallelism" target="_top">parallel
algorithms</a>, like for instance a parallel version of <a href="http://en.cppreference.com/w/cpp/algorithm/for_each" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span></code></a>;
it is only natural then to provide the corresponding <a class="link" href="tutorial.html#poly_collection.tutorial.algorithms" title="Algorithms">Boost.PolyCollection-specific
algorithms</a>. The segmented nature of polymorphic collections makes
them particularly amenable to parallel processing.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.future_work.variant_collection"></a><a class="link" href="future_work.html#poly_collection.future_work.variant_collection" title="variant_collection"><code class="computeroutput"><span class="identifier">variant_collection</span></code></a>
</h3></div></div></div>
<p>
<span class="emphasis"><em>Closed polymorphism</em></span> is a kind of dynamic polymorphism
where the set of implementation types is fixed at definition time: the prime
example of this paradigm in C++ is <a href="http://en.cppreference.com/w/cpp/utility/variant" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span></code></a>.
Although <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;&gt;&gt;</span></code> can act as a sort of replacement
for <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,...,</span><span class="identifier">TN</span><span class="special">&gt;&gt;</span></code>, this is in fact more similar to
a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span></code><a href="http://en.cppreference.com/w/cpp/utility/any" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">any</span></code></a><code class="computeroutput"><span class="special">&gt;</span></code>, and a collection class <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">variant_collection</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,...,</span><span class="identifier">TN</span><span class="special">&gt;</span></code>
could be designed to better model closed polymorphism and take further advantage
of the fact that implementation types are fixed (for instance, internal virtual
calls can be completely eliminated). From a conceptual point of view, this
would require introducing a new <span class="bold"><strong><code class="computeroutput"><span class="identifier">ClosedPolymorphicCollection</span></code></strong></span>
notion and renaming the current <a class="link" href="reference.html#poly_collection.reference.polymorphic_containers.polymorphic_collections" title="Polymorphic collections"><span class="bold"><strong><code class="computeroutput"><span class="identifier">PolymorphicCollection</span></code></strong></span></a>
model to <span class="bold"><strong><code class="computeroutput"><span class="identifier">OpenPolymorphicCollection</span></code></strong></span>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.future_work.ordered_polymorphic_collections"></a><a class="link" href="future_work.html#poly_collection.future_work.ordered_polymorphic_collections" title="Ordered polymorphic collections">Ordered
polymorphic collections</a>
</h3></div></div></div>
<p>
Users have expressed interest in polymorphic collections where elements are
kept ordered within their segment and optionally duplicates are excluded,
much like <a href="http://boost.org/doc/html/container/non_standard_containers.html#container.non_standard_containers.flat_xxx" target="_top"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">flat_set</span></code>/<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">flat_multiset</span></code></a>
do over their internal data vector. The open question remains of whether
these collections should also guarantee some order between segments (current
ones don't) to allow for the definition of container-level <code class="computeroutput"><span class="keyword">operator</span><span class="special">&lt;</span></code>
and related operators.
</p>
</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 © 2016-2021 Joaquín M López Muñoz<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="reference.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="release_notes.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -0,0 +1,735 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Performance</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../poly_collection.html" title="Chapter 29. Boost.PolyCollection">
<link rel="prev" href="tutorial.html" title="Tutorial">
<link rel="next" href="reference.html" title="Reference">
</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="tutorial.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="reference.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="poly_collection.performance"></a><a class="link" href="performance.html" title="Performance">Performance</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.container_definitions">Container
definitions</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests">Insertion
tests</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests">Processing
tests</a></span></dt>
</dl></div>
<p>
(Testing program at <a href="../../../libs/poly_collection/example/perf.cpp" target="_top"><code class="computeroutput"><span class="identifier">perf</span><span class="special">.</span><span class="identifier">cpp</span></code></a>.)
</p>
<p>
We ran tests to measure the performance of the containers of Boost.PolyCollection
in two scenarios:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Insertion of elements.
</li>
<li class="listitem">
Linear traversal and processing with <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span></code>
and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">poly_collection</span><span class="special">::</span><span class="identifier">for_each</span></code> (with and without <a class="link" href="tutorial.html#poly_collection.tutorial.algorithms.type_restitution" title="Type restitution">type
restitution</a>).
</li>
</ul></div>
<p>
As a comparison baseline we used containers and facilities from the standard
library and Boost (details below). Tests were run in the following environments:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<span class="bold"><strong>Visual Studio 2015 x86</strong></span>: Visual C++ 2015
in 32-bit (x86) release mode, Windows 7 64-bit, Intel Core i5-2520M @2.5GHz
</li>
<li class="listitem">
<span class="bold"><strong>Visual Studio 2015 x64</strong></span>: Visual C++ 2015
in 64-bit (x64) release mode, same machine
</li>
<li class="listitem">
<span class="bold"><strong>GCC 6.3 x64</strong></span>: GCC 6.3 release mode, Xubuntu
17.04 x64, Intel Core i7-5820 @3.3GHz
</li>
<li class="listitem">
<span class="bold"><strong>Clang 4.0 x64</strong></span>: Clang 4.0 release mode,
same machine
</li>
</ul></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.performance.container_definitions"></a><a class="link" href="performance.html#poly_collection.performance.container_definitions" title="Container definitions">Container
definitions</a>
</h3></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.container_definitions.boost_base_collection"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span></code></a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.container_definitions.boost_function_collection"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_collection</span></code></a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.container_definitions.boost_any_collection"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span></code></a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="poly_collection.performance.container_definitions.boost_base_collection"></a><a class="link" href="performance.html#poly_collection.performance.container_definitions.boost_base_collection" title="boost::base_collection"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span></code></a>
</h4></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Baseline container: <code class="computeroutput"><span class="identifier">ptr_vector</span></code>
= <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ptr_vector</span><span class="special">&lt;</span><span class="identifier">base</span><span class="special">&gt;</span></code>
</li>
<li class="listitem">
Polymorphic collection: <code class="computeroutput"><span class="identifier">base_collection</span></code>
= <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span><span class="special">&lt;</span><span class="identifier">base</span><span class="special">&gt;</span></code>
</li>
<li class="listitem">
Element types: <code class="computeroutput"><span class="identifier">T1</span></code> =
<code class="computeroutput"><span class="identifier">derived1</span></code>, <code class="computeroutput"><span class="identifier">T2</span></code> = <code class="computeroutput"><span class="identifier">derived2</span></code>,
<code class="computeroutput"><span class="identifier">T3</span></code> = <code class="computeroutput"><span class="identifier">derived3</span></code>
</li>
</ul></div>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">base</span>
<span class="special">{</span>
<span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">base</span><span class="special">()=</span><span class="keyword">default</span><span class="special">;</span>
<span class="keyword">virtual</span> <span class="keyword">int</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span><span class="special">)</span><span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
<span class="special">};</span>
<span class="keyword">struct</span> <span class="identifier">derived1</span> <span class="identifier">final</span><span class="special">:</span><span class="identifier">base</span>
<span class="special">{</span>
<span class="identifier">derived1</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">):</span><span class="identifier">n</span><span class="special">{</span><span class="identifier">n</span><span class="special">}{}</span>
<span class="keyword">virtual</span> <span class="keyword">int</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span><span class="special">)</span><span class="keyword">const</span><span class="special">{</span><span class="keyword">return</span> <span class="identifier">n</span><span class="special">;}</span>
<span class="keyword">int</span> <span class="identifier">n</span><span class="special">;</span>
<span class="special">};</span>
<span class="keyword">struct</span> <span class="identifier">derived2</span> <span class="identifier">final</span><span class="special">:</span><span class="identifier">base</span>
<span class="special">{</span>
<span class="identifier">derived2</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">):</span><span class="identifier">n</span><span class="special">{</span><span class="identifier">n</span><span class="special">}{}</span>
<span class="keyword">virtual</span> <span class="keyword">int</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span><span class="keyword">const</span><span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span><span class="special">*</span><span class="identifier">n</span><span class="special">;}</span>
<span class="keyword">int</span> <span class="identifier">unused</span><span class="special">,</span><span class="identifier">n</span><span class="special">;</span>
<span class="special">};</span>
<span class="keyword">struct</span> <span class="identifier">derived3</span> <span class="identifier">final</span><span class="special">:</span><span class="identifier">base</span>
<span class="special">{</span>
<span class="identifier">derived3</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">):</span><span class="identifier">n</span><span class="special">{</span><span class="identifier">n</span><span class="special">}{}</span>
<span class="keyword">virtual</span> <span class="keyword">int</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span><span class="keyword">const</span><span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span><span class="special">*</span><span class="identifier">x</span><span class="special">*</span><span class="identifier">n</span><span class="special">;}</span>
<span class="keyword">int</span> <span class="identifier">unused</span><span class="special">,</span><span class="identifier">n</span><span class="special">;</span>
<span class="special">};</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="poly_collection.performance.container_definitions.boost_function_collection"></a><a class="link" href="performance.html#poly_collection.performance.container_definitions.boost_function_collection" title="boost::function_collection"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_collection</span></code></a>
</h4></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Baseline container: <code class="computeroutput"><span class="identifier">func_vector</span></code>
= <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">(</span><span class="keyword">int</span><span class="special">)&gt;&gt;</span></code>
</li>
<li class="listitem">
Polymorphic collection: <code class="computeroutput"><span class="identifier">function_collection</span></code>
= <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_collection</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">(</span><span class="keyword">int</span><span class="special">)&gt;</span></code>
</li>
<li class="listitem">
Element types: <code class="computeroutput"><span class="identifier">T1</span></code> =
<code class="computeroutput"><span class="identifier">concrete1</span></code>, <code class="computeroutput"><span class="identifier">T2</span></code> = <code class="computeroutput"><span class="identifier">concrete2</span></code>,
<code class="computeroutput"><span class="identifier">T3</span></code> = <code class="computeroutput"><span class="identifier">concrete3</span></code>
</li>
</ul></div>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">concrete1</span>
<span class="special">{</span>
<span class="identifier">concrete1</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">):</span><span class="identifier">n</span><span class="special">{</span><span class="identifier">n</span><span class="special">}{}</span>
<span class="keyword">int</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span><span class="special">)</span><span class="keyword">const</span><span class="special">{</span><span class="keyword">return</span> <span class="identifier">n</span><span class="special">;}</span>
<span class="keyword">int</span> <span class="identifier">n</span><span class="special">;</span>
<span class="special">};</span>
<span class="keyword">struct</span> <span class="identifier">concrete2</span>
<span class="special">{</span>
<span class="identifier">concrete2</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">):</span><span class="identifier">n</span><span class="special">{</span><span class="identifier">n</span><span class="special">}{}</span>
<span class="keyword">int</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span><span class="keyword">const</span><span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span><span class="special">*</span><span class="identifier">n</span><span class="special">;}</span>
<span class="keyword">int</span> <span class="identifier">unused</span><span class="special">,</span><span class="identifier">n</span><span class="special">;</span>
<span class="special">};</span>
<span class="keyword">struct</span> <span class="identifier">concrete3</span>
<span class="special">{</span>
<span class="identifier">concrete3</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">):</span><span class="identifier">n</span><span class="special">{</span><span class="identifier">n</span><span class="special">}{}</span>
<span class="keyword">int</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span><span class="keyword">const</span><span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span><span class="special">*</span><span class="identifier">x</span><span class="special">*</span><span class="identifier">n</span><span class="special">;}</span>
<span class="keyword">int</span> <span class="identifier">unused</span><span class="special">,</span><span class="identifier">n</span><span class="special">;</span>
<span class="special">};</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="poly_collection.performance.container_definitions.boost_any_collection"></a><a class="link" href="performance.html#poly_collection.performance.container_definitions.boost_any_collection" title="boost::any_collection"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span></code></a>
</h4></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Baseline container: <code class="computeroutput"><span class="identifier">any_vector</span></code>
= <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">type_erasure</span><span class="special">::</span><span class="identifier">any</span><span class="special">&lt;</span><span class="identifier">concept_</span><span class="special">&gt;&gt;</span></code>
</li>
<li class="listitem">
Polymorphic collection: <code class="computeroutput"><span class="identifier">any_collection</span></code>
= <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span><span class="special">&lt;</span><span class="identifier">concept_</span><span class="special">&gt;</span></code>
</li>
<li class="listitem">
Element types: <code class="computeroutput"><span class="identifier">T1</span></code> =
<code class="computeroutput"><span class="keyword">int</span></code>, <code class="computeroutput"><span class="identifier">T2</span></code>
= <code class="computeroutput"><span class="keyword">double</span></code>, <code class="computeroutput"><span class="identifier">T3</span></code> = <code class="computeroutput"><span class="keyword">char</span></code>
</li>
</ul></div>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">concept_</span><span class="special">=</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">type_erasure</span><span class="special">::</span><span class="identifier">copy_constructible</span><span class="special">&lt;&gt;,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">type_erasure</span><span class="special">::</span><span class="identifier">relaxed</span><span class="special">,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">type_erasure</span><span class="special">::</span><span class="identifier">typeid_</span><span class="special">&lt;&gt;,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">type_erasure</span><span class="special">::</span><span class="identifier">incrementable</span><span class="special">&lt;&gt;</span>
<span class="special">&gt;;</span>
</pre>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.performance.insertion_tests"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests" title="Insertion tests">Insertion
tests</a>
</h3></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span></code></a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_collection</span></code></a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span></code></a></span></dt>
</dl></div>
<p>
Tests measure the time taken to insert <span class="emphasis"><em>n</em></span> elements (<span class="emphasis"><em>n</em></span>
between 10<sup>2</sup> and 10<sup>7</sup>) from a source of values with types following the cyclic
sequence
</p>
<p>
<code class="computeroutput"><span class="identifier">T1</span></code> <code class="computeroutput"><span class="identifier">T1</span></code>
<code class="computeroutput"><span class="identifier">T2</span></code> <code class="computeroutput"><span class="identifier">T2</span></code>
<code class="computeroutput"><span class="identifier">T3</span></code> <code class="computeroutput"><span class="identifier">T1</span></code>
<code class="computeroutput"><span class="identifier">T1</span></code> <code class="computeroutput"><span class="identifier">T2</span></code>
<code class="computeroutput"><span class="identifier">T2</span></code> <code class="computeroutput"><span class="identifier">T3</span></code>
···
</p>
<p>
No <code class="computeroutput"><span class="identifier">reserve</span></code> operation is done
before insertion. The figures show resulting times in nanoseconds/element.
The horizontal axis is logarithmic.
</p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_base_collectio"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio" title="Results for boost::base_collection">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span></code></a>
</h4></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment">Visual
Studio 2015 x86</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment0">Visual
Studio 2015 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment1">GCC
6.3 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment2">Clang
4.0 x64</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment" title="Visual Studio 2015 x86">Visual
Studio 2015 x86</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_base_vs2015_x86.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, Visual Studio
2015 x86</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment0"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment0" title="Visual Studio 2015 x64">Visual
Studio 2015 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_base_vs2015_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, Visual Studio
2015 x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment1"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment1" title="GCC 6.3 x64">GCC
6.3 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_base_gcc63_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, GCC 6.3 x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment2"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_base_collectio.environment2" title="Clang 4.0 x64">Clang
4.0 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_base_clang40_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, Clang 4.0
x64</strong></span></span>
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_function_colle"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle" title="Results for boost::function_collection">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_collection</span></code></a>
</h4></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment">Visual
Studio 2015 x86</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment0">Visual
Studio 2015 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment1">GCC
6.3 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment2">Clang
4.0 x64</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment" title="Visual Studio 2015 x86">Visual
Studio 2015 x86</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_function_vs2015_x86.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, Visual Studio
2015 x86</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment0"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment0" title="Visual Studio 2015 x64">Visual
Studio 2015 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_function_vs2015_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, Visual Studio
2015 x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment1"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment1" title="GCC 6.3 x64">GCC
6.3 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_function_gcc63_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, GCC 6.3 x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment2"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_function_colle.environment2" title="Clang 4.0 x64">Clang
4.0 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_function_clang40_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, Clang 4.0
x64</strong></span></span>
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_any_collection"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection" title="Results for boost::any_collection">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span></code></a>
</h4></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment">Visual
Studio 2015 x86</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment0">Visual
Studio 2015 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment1">GCC
6.3 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment2">Clang
4.0 x64</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment" title="Visual Studio 2015 x86">Visual
Studio 2015 x86</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_any_vs2015_x86.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, Visual Studio
2015 x86</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment0"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment0" title="Visual Studio 2015 x64">Visual
Studio 2015 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_any_vs2015_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, Visual Studio
2015 x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment1"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment1" title="GCC 6.3 x64">GCC
6.3 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_any_gcc63_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, GCC 6.3 x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment2"></a><a class="link" href="performance.html#poly_collection.performance.insertion_tests.results_for_boost_any_collection.environment2" title="Clang 4.0 x64">Clang
4.0 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/insert_any_clang40_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Insertion, Clang 4.0
x64</strong></span></span>
</p>
</div>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.performance.processing_tests"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests" title="Processing tests">Processing
tests</a>
</h3></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span></code></a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_collection</span></code></a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span></code></a></span></dt>
</dl></div>
<p>
Tests measure the time taken to traverse a container of size <span class="emphasis"><em>n</em></span>
(<span class="emphasis"><em>n</em></span> between 10<sup>2</sup> and 10<sup>7</sup>) and execute an operation on each
of its elements. The operation for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span></code>
and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_collection</span></code> (and the associated
baseline containers) is defined as
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">for_each_callable</span>
<span class="special">{</span>
<span class="identifier">for_each_callable</span><span class="special">():</span><span class="identifier">res</span><span class="special">{</span><span class="number">0</span><span class="special">}{}</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">){</span>
<span class="identifier">res</span><span class="special">+=</span><span class="identifier">x</span><span class="special">(</span><span class="number">2</span><span class="special">);</span>
<span class="special">}</span>
<span class="keyword">int</span> <span class="identifier">res</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
whereas for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span></code> we use
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">for_each_incrementable</span>
<span class="special">{</span>
<span class="identifier">for_each_incrementable</span><span class="special">():</span><span class="identifier">res</span><span class="special">{</span><span class="number">0</span><span class="special">}{}</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">){</span>
<span class="special">++</span><span class="identifier">x</span><span class="special">;</span>
<span class="special">++</span><span class="identifier">res</span><span class="special">;</span>
<span class="special">}</span>
<span class="keyword">int</span> <span class="identifier">res</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
The baseline container is tested with three different setups:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Directly as initialized by the process described for the <a class="link" href="performance.html#poly_collection.performance.insertion_tests" title="Insertion tests">insertion
tests</a>. The sequence of types is complex enough that CPU's branch
prediction mechanisms are not able to fully anticipate it <a href="#ftn.poly_collection.performance.processing_tests.f0" class="footnote" name="poly_collection.performance.processing_tests.f0"><sup class="footnote">[21]</sup></a>. As elements are ordered according to their construction
time, certain degree of memory contiguity is expected.
</li>
<li class="listitem">
With an extra post-insertion stage by which elements are sorted according
to their <code class="computeroutput"><span class="keyword">typeid</span><span class="special">()</span></code>.
This increases branch prediction efficiency at the expense of having
worse cache friendliness.
</li>
<li class="listitem">
With an extra post-insertion stage that randomly shuffles all the elements
in the container. This is the worst possible scenario both in terms of
caching and branch prediction.
</li>
</ul></div>
<p>
As for the polymorphic collection, three variations are measured:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
With <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span></code> (the same as the baseline
container).
</li>
<li class="listitem">
Using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">poly_collection</span><span class="special">::</span><span class="identifier">for_each</span></code>.
</li>
<li class="listitem">
Using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">poly_collection</span><span class="special">::</span><span class="identifier">for_each</span></code> with <a class="link" href="tutorial.html#poly_collection.tutorial.algorithms.type_restitution" title="Type restitution"><span class="emphasis"><em>type
restitution</em></span></a> of <code class="computeroutput"><span class="identifier">T1</span></code>,
<code class="computeroutput"><span class="identifier">T2</span></code> and <code class="computeroutput"><span class="identifier">T3</span></code>.
</li>
</ul></div>
<p>
The figures show resulting times in nanoseconds/element. The horizontal axis
is logarithmic.
</p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_base_collectio"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio" title="Results for boost::base_collection">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">base_collection</span></code></a>
</h4></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment">Visual
Studio 2015 x86</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment0">Visual
Studio 2015 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment1">GCC
6.3 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment2">Clang
4.0 x64</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment" title="Visual Studio 2015 x86">Visual
Studio 2015 x86</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_base_vs2015_x86.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, Visual Studio
2015 x86</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment0"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment0" title="Visual Studio 2015 x64">Visual
Studio 2015 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_base_vs2015_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, Visual Studio
2015 x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment1"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment1" title="GCC 6.3 x64">GCC
6.3 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_base_gcc63_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, GCC 6.3
x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment2"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_base_collectio.environment2" title="Clang 4.0 x64">Clang
4.0 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_base_clang40_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, Clang 4.0
x64</strong></span></span>
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_function_colle"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle" title="Results for boost::function_collection">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">function_collection</span></code></a>
</h4></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle.environment">Visual
Studio 2015 x86</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle.environment0">Visual
Studio 2015 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle.environment1">GCC
6.3 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle.environment2">Clang
4.0 x64</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_function_colle.environment"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle.environment" title="Visual Studio 2015 x86">Visual
Studio 2015 x86</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_function_vs2015_x86.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, Visual Studio
2015 x86</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_function_colle.environment0"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle.environment0" title="Visual Studio 2015 x64">Visual
Studio 2015 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_function_vs2015_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, Visual Studio
2015 x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_function_colle.environment1"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle.environment1" title="GCC 6.3 x64">GCC
6.3 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_function_gcc63_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, GCC 6.3
x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_function_colle.environment2"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_function_colle.environment2" title="Clang 4.0 x64">Clang
4.0 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_function_clang40_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, Clang 4.0
x64</strong></span></span>
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_any_collection"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection" title="Results for boost::any_collection">Results
for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any_collection</span></code></a>
</h4></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection.environment">Visual
Studio 2015 x86</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection.environment0">Visual
Studio 2015 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection.environment1">GCC
6.3 x64</a></span></dt>
<dt><span class="section"><a href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection.environment2">Clang
4.0 x64</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_any_collection.environment"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection.environment" title="Visual Studio 2015 x86">Visual
Studio 2015 x86</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_any_vs2015_x86.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, Visual Studio
2015 x86</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_any_collection.environment0"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection.environment0" title="Visual Studio 2015 x64">Visual
Studio 2015 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_any_vs2015_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, Visual Studio
2015 x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_any_collection.environment1"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection.environment1" title="GCC 6.3 x64">GCC
6.3 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_any_gcc63_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, GCC 6.3
x64</strong></span></span>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="poly_collection.performance.processing_tests.results_for_boost_any_collection.environment2"></a><a class="link" href="performance.html#poly_collection.performance.processing_tests.results_for_boost_any_collection.environment2" title="Clang 4.0 x64">Clang
4.0 x64</a>
</h5></div></div></div>
<p>
<span class="aligncenter"><span class="inlinemediaobject"><img src="img/for_each_any_clang40_x64.png"></span>
</span>
<span class="aligncenter"><span class="bold"><strong>Processing, Clang 4.0
x64</strong></span></span>
</p>
</div>
</div>
</div>
<div class="footnotes">
<br><hr style="width:100; text-align:left;margin-left: 0">
<div id="ftn.poly_collection.performance.processing_tests.f0" class="footnote"><p><a href="#poly_collection.performance.processing_tests.f0" class="para"><sup class="para">[21] </sup></a>
This has been verified empirically: simpler cycles did indeed yield
better execution times.
</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 © 2016-2021 Joaquín M López Muñoz<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="tutorial.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="reference.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,182 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Release notes</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../poly_collection.html" title="Chapter 29. Boost.PolyCollection">
<link rel="prev" href="future_work.html" title="Future work">
<link rel="next" href="acknowledgments.html" title="Acknowledgments">
</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="future_work.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="acknowledgments.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="poly_collection.release_notes"></a><a class="link" href="release_notes.html" title="Release notes">Release notes</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_76">Boost 1.76</a></span></dt>
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_74">Boost 1.74</a></span></dt>
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_73">Boost 1.73</a></span></dt>
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_72">Boost 1.72</a></span></dt>
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_71">Boost 1.71</a></span></dt>
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_70">Boost 1.70</a></span></dt>
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_69">Boost 1.69</a></span></dt>
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_67">Boost 1.67</a></span></dt>
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_66">Boost 1.66</a></span></dt>
<dt><span class="section"><a href="release_notes.html#poly_collection.release_notes.boost_1_65">Boost 1.65</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_76"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_76" title="Boost 1.76">Boost 1.76</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Worked around <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95888" target="_top">GCC
bug</a> affecting GCC versions 9.3-10.2 (issue <a href="https://github.com/boostorg/poly_collection/issues/20" target="_top">#20</a>).
</li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_74"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_74" title="Boost 1.74">Boost 1.74</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Fixed internal ambiguity problem between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">type_erasure</span><span class="special">::</span><span class="identifier">any</span></code>
and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">any</span></code> (issue <a href="https://github.com/boostorg/poly_collection/issues/17" target="_top">#17</a>).
</li>
<li class="listitem">
Maintenance work.
</li>
</ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_73"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_73" title="Boost 1.73">Boost 1.73</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Suppressed a potential redundant move warning in <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">poly_collection</span><span class="special">::</span><span class="identifier">for_each</span></code>.
</li>
<li class="listitem">
Fixed a bug by which elements were copied rather than moved in allocator-extended
move construction and move assigment between collections with non-propagating,
unequal allocators.
</li>
<li class="listitem">
Allocator-extended move construction no longer decays to allocator-extended
copy construction for the legacy version of libstdc++-v3 shipped with
GCC 4.8 (which can also be used by Clang).
</li>
</ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_72"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_72" title="Boost 1.72">Boost 1.72</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Maintenance work.
</li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_71"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_71" title="Boost 1.71">Boost 1.71</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Maintenance work.
</li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_70"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_70" title="Boost 1.70">Boost 1.70</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Improved handling of stateful allocators and allocator propagation traits,
after an error reported by Billy O'Neal (<a href="https://github.com/boostorg/poly_collection/pull/9" target="_top">PR#9</a>).
</li>
<li class="listitem">
Fixed a potentially serious bug with an internal cache structure.
</li>
</ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_69"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_69" title="Boost 1.69">Boost 1.69</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Added Boost.PolyCollection-specific versions of algorithms <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each_n</span></code> and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">sample</span></code>.
</li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_67"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_67" title="Boost 1.67">Boost 1.67</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Maintenance fixes.
</li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_66"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_66" title="Boost 1.66">Boost 1.66</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Boost.PolyCollection has been backported to GCC 4.8 to 4.9 and Clang
3.3 to 3.6. The version of libstdc++-v3 shipped with GCC 4.8 (which can
also be used by Clang) has deficiencies that result in the following
limitations when using Boost.PolyCollection:
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
Stateful allocators are not properly supported.
</li>
<li class="listitem">
Allocator-extended move construction decays to allocator-extended
copy construction.
</li>
<li class="listitem">
Copy construction crashes if an exception is thrown during element
copying.
</li>
</ul></div>
</li>
<li class="listitem">
Maintenance fixes.
</li>
</ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="poly_collection.release_notes.boost_1_65"></a><a class="link" href="release_notes.html#poly_collection.release_notes.boost_1_65" title="Boost 1.65">Boost 1.65</a>
</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Initial release.
</li></ul></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 © 2016-2021 Joaquín M López Muñoz<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="future_work.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../poly_collection.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="acknowledgments.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff