Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59822 - in sandbox/tokenmap/libs/tokenmap/doc: . html html/tokenmap
From: sl_at_[hidden]
Date: 2010-02-21 15:23:45


Author: sl_
Date: 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
New Revision: 59822
URL: http://svn.boost.org/trac/boost/changeset/59822

Log:
performance comp
Text files modified:
   sandbox/tokenmap/libs/tokenmap/doc/html/index.html | 5 +--
   sandbox/tokenmap/libs/tokenmap/doc/html/standalone_HTML.manifest | 1
   sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/acknowledgements_.html | 6 ++--
   sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/examples_.html | 46 ++++++++++++++++++++++++++++++++++++++-
   sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/performance_.html | 21 ++++++++++++++++-
   sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/quick_tutorial.html | 4 +-
   sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/rationale_.html | 20 +++++++++++++----
   sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/reference.html | 10 ++++----
   sandbox/tokenmap/libs/tokenmap/doc/tokenmap.qbk | 34 +++++++++++++++++++++++++++-
   9 files changed, 122 insertions(+), 25 deletions(-)

Modified: sandbox/tokenmap/libs/tokenmap/doc/html/index.html
==============================================================================
--- sandbox/tokenmap/libs/tokenmap/doc/html/index.html (original)
+++ sandbox/tokenmap/libs/tokenmap/doc/html/index.html 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
@@ -27,7 +27,7 @@
 </h3></div></div>
 <div><p class="copyright">Copyright &#169; 2009 Slawomir Lisznianski</p></div>
 <div><div class="legalnotice">
-<a name="id477452"></a><p>
+<a name="id563093"></a><p>
         Distributed under the Boost Software License, Version 1.0. (See accompanying
         file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       </p>
@@ -42,7 +42,6 @@
 <dt><span class="section">Performance </span></dt>
 <dt><span class="section">Examples </span></dt>
 <dt><span class="section">Rationale </span></dt>
-<dt><span class="section">Future Work </span></dt>
 <dt><span class="section">Acknowledgements </span></dt>
 </dl>
 </div>
@@ -67,7 +66,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: February 21, 2010 at 19:46:48 GMT</small></p></td>
+<td align="left"><p><small>Last revised: February 21, 2010 at 20:23:17 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/tokenmap/libs/tokenmap/doc/html/standalone_HTML.manifest
==============================================================================
--- sandbox/tokenmap/libs/tokenmap/doc/html/standalone_HTML.manifest (original)
+++ sandbox/tokenmap/libs/tokenmap/doc/html/standalone_HTML.manifest 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
@@ -4,5 +4,4 @@
 tokenmap/performance_.html
 tokenmap/examples_.html
 tokenmap/rationale_.html
-tokenmap/future_work_.html
 tokenmap/acknowledgements_.html

Modified: sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/acknowledgements_.html
==============================================================================
--- sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/acknowledgements_.html (original)
+++ sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/acknowledgements_.html 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
@@ -6,7 +6,7 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
 <link rel="start" href="../index.html" title="Chapter&#160;1.&#160;Boost.Tokenmap">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.Tokenmap">
-<link rel="prev" href="future_work_.html" title="Future Work">
+<link rel="prev" href="rationale_.html" title="Rationale">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -19,7 +19,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="future_work_.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a>
+<a accesskey="p" href="rationale_.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a>
 </div>
 <div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both">
 <a name="tokenmap.acknowledgements_"></a><a class="link" href="acknowledgements_.html" title="Acknowledgements">Acknowledgements </a>
@@ -34,7 +34,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="future_work_.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a>
+<a accesskey="p" href="rationale_.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a>
 </div>
 </body>
 </html>

Modified: sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/examples_.html
==============================================================================
--- sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/examples_.html (original)
+++ sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/examples_.html 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
@@ -22,9 +22,51 @@
 <div class="spirit-nav">
 <a accesskey="p" href="performance_.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="rationale_.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
-<div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
 <a name="tokenmap.examples_"></a><a class="link" href="examples_.html" title="Examples">Examples </a>
-</h2></div></div></div></div>
+</h2></div></div></div>
+<p>
+ In the folder libs/tokenmap/example you
+ can find all the examples used in tokenmap documentation. Here is a list of
+ them:
+ </p>
+<div class="table">
+<a name="id573346"></a><p class="title"><b>Table&#160;1.1.&#160;Tutorial examples</b></p>
+<div class="table-contents"><table class="table" summary="Tutorial examples">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Program
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <a href="../../../example/simple_tokenmap.cpp" target="_top">simple_tokenmap.cpp
+ </a>
+ </p>
+ </td>
+<td>
+ <p>
+ Basic operations example
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<br class="table-break">
+</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 &#169; 2009 Slawomir Lisznianski<p>

Modified: sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/performance_.html
==============================================================================
--- sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/performance_.html (original)
+++ sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/performance_.html 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
@@ -22,9 +22,26 @@
 <div class="spirit-nav">
 <a accesskey="p" href="reference.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="examples_.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
-<div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
 <a name="tokenmap.performance_"></a><a class="link" href="performance_.html" title="Performance">Performance </a>
-</h2></div></div></div></div>
+</h2></div></div></div>
+<p>
+ (this section requires far more work)
+ </p>
+<p>
+ Below is a comparison of insertions and lookups, compiled with gcc 4.4.1:
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">map</span><span class="special">&lt;</span><span class="identifier">token</span><span class="special">,</span> <span class="identifier">session</span><span class="special">*&gt;</span> <span class="identifier">map_type</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">tokenmap</span><span class="special">&lt;</span><span class="identifier">session</span><span class="special">,</span> <span class="identifier">uint32_t</span><span class="special">&gt;</span> <span class="identifier">token_type</span><span class="special">;</span>
+
+<span class="identifier">tokenmap</span> <span class="identifier">insert</span><span class="special">:</span> <span class="number">0.107066</span> <span class="identifier">usecs</span> <span class="identifier">per</span> <span class="identifier">op</span>
+<span class="identifier">stdmap</span> <span class="identifier">insert</span><span class="special">:</span> <span class="number">0.693195</span> <span class="identifier">usecs</span> <span class="identifier">per</span> <span class="identifier">op</span>
+
+<span class="identifier">tokenmap</span> <span class="identifier">find</span><span class="special">:</span> <span class="number">0.011401</span> <span class="identifier">usecs</span> <span class="identifier">per</span> <span class="identifier">op</span>
+<span class="identifier">stdmap</span> <span class="identifier">find</span><span class="special">:</span> <span class="number">0.344964</span> <span class="identifier">usecs</span> <span class="identifier">per</span> <span class="identifier">op</span>
+</pre>
+</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 &#169; 2009 Slawomir Lisznianski<p>

Modified: sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/quick_tutorial.html
==============================================================================
--- sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/quick_tutorial.html (original)
+++ sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/quick_tutorial.html 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
@@ -67,8 +67,8 @@
 <p>
       Finally, we can remove the element:
     </p>
-<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special">&lt;</span><span class="identifier">map_type</span><span class="special">::</span><span class="identifier">mapped_type</span><span class="special">&gt;</span> <span class="identifier">take_over</span>
- <span class="special">=</span> <span class="identifier">names</span><span class="special">.</span><span class="identifier">pop</span><span class="special">(</span> <span class="identifier">rob</span><span class="special">.</span><span class="identifier">first</span> <span class="special">);</span>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">auto_ptr</span><span class="special">&lt;</span><span class="identifier">map_type</span><span class="special">::</span><span class="identifier">mapped_type</span><span class="special">&gt;</span> <span class="identifier">take_over</span> <span class="special">=</span>
+ <span class="identifier">names</span><span class="special">.</span><span class="identifier">pop</span><span class="special">(</span> <span class="identifier">rob</span><span class="special">.</span><span class="identifier">first</span> <span class="special">);</span>
 </pre>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/rationale_.html
==============================================================================
--- sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/rationale_.html (original)
+++ sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/rationale_.html 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
@@ -7,7 +7,7 @@
 <link rel="start" href="../index.html" title="Chapter&#160;1.&#160;Boost.Tokenmap">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Boost.Tokenmap">
 <link rel="prev" href="examples_.html" title="Examples">
-<link rel="next" href="future_work_.html" title="Future Work">
+<link rel="next" href="acknowledgements_.html" title="Acknowledgements">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,11 +20,21 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="examples_.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="future_work_.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="examples_.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="acknowledgements_.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
-<div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
 <a name="tokenmap.rationale_"></a><a class="link" href="rationale_.html" title="Rationale">Rationale </a>
-</h2></div></div></div></div>
+</h2></div></div></div>
+<p>
+ Network applications often require keeping track of sessions where a "session
+ key" is exchanged between a server and a client. The server then keeps
+ track of the client's state by having the session key mapped to an in-memory
+ "session object". Today, developers often use <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span></code> for
+ this purpose, which has sub-optimal performance and requires users to come
+ up with sufficiently hard to guess random keys.
+ </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 &#169; 2009 Slawomir Lisznianski<p>
@@ -35,7 +45,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="examples_.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="future_work_.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="examples_.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="acknowledgements_.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/reference.html
==============================================================================
--- sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/reference.html (original)
+++ sandbox/tokenmap/libs/tokenmap/doc/html/tokenmap/reference.html 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
@@ -27,7 +27,7 @@
 <a name="tokenmap.reference"></a><a class="link" href="reference.html" title="Reference">Reference</a>
 </h2></div></div></div>
 <a name="tokenmap.reference.headers"></a><h4>
-<a name="id486700"></a>
+<a name="id572341"></a>
       <a class="link" href="reference.html#tokenmap.reference.headers">Headers</a>
     </h4>
 <p>
@@ -36,7 +36,7 @@
       to boost namespace.
     </p>
 <a name="tokenmap.reference.synopsis"></a><h4>
-<a name="id486727"></a>
+<a name="id572368"></a>
       <a class="link" href="reference.html#tokenmap.reference.synopsis">Synopsis</a>
     </h4>
 <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
@@ -83,15 +83,15 @@
 </span><span class="special">}</span> <span class="comment">// namespace boost
 </span></pre>
 <a name="tokenmap.reference.class_template_tokenmap"></a><h4>
-<a name="id487314"></a>
+<a name="id572955"></a>
       <a class="link" href="reference.html#tokenmap.reference.class_template_tokenmap">Class template tokenmap</a>
     </h4>
 <a name="tokenmap.reference.nested_types"></a><h4>
-<a name="id487329"></a>
+<a name="id572969"></a>
       <a class="link" href="reference.html#tokenmap.reference.nested_types">Nested types</a>
     </h4>
 <a name="tokenmap.reference.constructors__copy_and_assignment"></a><h4>
-<a name="id487343"></a>
+<a name="id572984"></a>
       <a class="link" href="reference.html#tokenmap.reference.constructors__copy_and_assignment">Constructors,
       copy and assignment</a>
     </h4>

Modified: sandbox/tokenmap/libs/tokenmap/doc/tokenmap.qbk
==============================================================================
--- sandbox/tokenmap/libs/tokenmap/doc/tokenmap.qbk (original)
+++ sandbox/tokenmap/libs/tokenmap/doc/tokenmap.qbk 2010-02-21 15:23:44 EST (Sun, 21 Feb 2010)
@@ -216,15 +216,45 @@
 [endsect]
 
 [section Performance ]
+
+(this section requires far more work)
+
+Below is a comparison of insertions and lookups, compiled with gcc 4.4.1:
+
+ typedef map<token, session*> map_type;
+ typedef tokenmap<session, uint32_t> token_type;
+
+ tokenmap insert: 0.107066 usecs per op
+ stdmap insert: 0.693195 usecs per op
+
+ tokenmap find: 0.011401 usecs per op
+ stdmap find: 0.344964 usecs per op
+
 [endsect]
 
 [section Examples ]
+
+In the folder [@../../example libs/tokenmap/example] you can find all the examples
+used in tokenmap documentation. Here is a list of them:
+
+[table Tutorial examples
+[[Program ][Description ]]
+
+[[[@../../example/simple_tokenmap.cpp
+ simple_tokenmap.cpp ]]
+ [Basic operations example ]]
+]
+
 [endsect]
 
 [section Rationale ]
-[endsect]
 
-[section Future Work ]
+Network applications often require keeping track of sessions where a "session key" is
+exchanged between a server and a client. The server then keeps track of the client's
+state by having the session key mapped to an in-memory "session object".
+Today, developers often use `std::map` for this purpose, which has sub-optimal
+performance and requires users to come up with sufficiently hard to guess random keys.
+
 [endsect]
 
 [section Acknowledgements ]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk