From 213b0ff14bc419a1784cc7685a32822f2256ab37 Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 28 Dec 2012 17:11:44 -0500 Subject: [PATCH] Added speed information about the pipe and bridge --- docs/docs/network.xml | 22 ++++++++++++++++++++++ docs/docs/other.xml | 19 +++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/docs/docs/network.xml b/docs/docs/network.xml index 6ad4ec26f..8194632f8 100644 --- a/docs/docs/network.xml +++ b/docs/docs/network.xml @@ -73,6 +73,28 @@ This object is a tool for bridging a pipe object between two network connected applications. + +

+ 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. +

+

+ In the first experiment, 1-megapixel images, represented with + array<rgb_pixel> objects, were sent. The transfer rate was + 112 megabytes/second, saturating the gigabit ethernet link. The second + experiment used a pipe<char> and bridge to send individual + char 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). +

+

+ 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. +

bridge_ex.cpp.html diff --git a/docs/docs/other.xml b/docs/docs/other.xml index 0aa409fb6..ed2669f67 100644 --- a/docs/docs/other.xml +++ b/docs/docs/other.xml @@ -331,8 +331,23 @@ dlib/pipe.h dlib/pipe/pipe_kernel_abstract.h - This is a first in first out queue with a fixed maximum size containing items - of type T. It is suitable for passing objects between threads. + This is a first in first out queue with a fixed maximum size. + It is suitable for passing objects between threads. + +

+ This object is optimized for speed, therefore, it uses + global swap() 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 std::vector<int> objects a second between two + threads. This is regardless of the number of ints in the std::vector + objects. In particular, this test was done with 100,000 + ints in each std::vector. +

+

+ Finally, note that you can use the pipe as an efficient method to pass + messages between two networked computers by using the bridge. +