Commit 213b0ff1 authored by Davis King's avatar Davis King

Added speed information about the pipe and bridge

parent 2c1a2f4e
...@@ -73,6 +73,28 @@ ...@@ -73,6 +73,28 @@
<description> <description>
This object is a tool for bridging a <a href="other.html#pipe">pipe</a> object between This object is a tool for bridging a <a href="other.html#pipe">pipe</a> object between
two network connected applications. two network connected applications.
<p>
The bridge object is designed to link two pipes together as efficiently as
possible. To demonstrate its speed, I ran two experiments where a bridge was
used to connect a desktop PC to a laptop, both running Ubuntu 12.04 and
connected via gigabit ethernet. The first experiment is to test its bulk
transfer speed while the second experiment measures how many separate objects
the bridge can transfer each second.
</p>
<p>
In the first experiment, 1-megapixel images, represented with
<tt>array&lt;rgb_pixel&gt;</tt> objects, were sent. The transfer rate was
112 megabytes/second, saturating the gigabit ethernet link. The second
experiment used a <tt>pipe&lt;char&gt;</tt> and <tt>bridge</tt> to send individual
<tt>char</tt> variables over the network. In this experiment, I was able to
send 3.2 million objects a second (i.e. the receiving end was getting a char
back from pipe::dequeue() 3.2 million times each second).
</p>
<p>
For reference, these experiments were carried out on a desktop with a 2.67GHz
Intel Core-i7 CPU and a laptop with a 2.20GHz Intel Core-i7 CPU.
</p>
</description> </description>
<examples> <examples>
<example>bridge_ex.cpp.html</example> <example>bridge_ex.cpp.html</example>
......
...@@ -331,8 +331,23 @@ ...@@ -331,8 +331,23 @@
<file>dlib/pipe.h</file> <file>dlib/pipe.h</file>
<spec_file>dlib/pipe/pipe_kernel_abstract.h</spec_file> <spec_file>dlib/pipe/pipe_kernel_abstract.h</spec_file>
<description> <description>
This is a first in first out queue with a fixed maximum size containing items This is a first in first out queue with a fixed maximum size.
of type T. It is suitable for passing objects between threads. It is suitable for passing objects between threads.
<p>
This object is optimized for speed, therefore, it uses
global <tt>swap()</tt> to create a zero-copy method for moving objects
around. For example, on a computer running Ubuntu 12.04 with
a 2.67GHz Intel i7 920 CPU it is possible to pass over 4.4
million <tt>std::vector&lt;int&gt;</tt> objects a second between two
threads. This is regardless of the number of ints in the <tt>std::vector</tt>
objects. In particular, this test was done with 100,000
ints in each <tt>std::vector</tt>.
</p>
<p>
Finally, note that you can use the pipe as an efficient method to pass
messages between two networked computers by using the <a href="network.html#bridge">bridge</a>.
</p>
</description> </description>
<examples> <examples>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment