Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

Difference between revisions of "Pipe vs Unix Socket Performance"

From wiki.openlighting.org

Jump to: navigation, search
(Created page with "Here are some numbers on pipe() vs socketpair() performance. The sample program used either pipe() or socketpair() to create a set of file descriptors. The main thread sent 512MB…")
 
Line 24: Line 24:
 
</pre>
 
</pre>
  
== Linux ==  
+
== Linux 2.6.26-2-amd64 ==  
  
 +
<pre>
 +
Pipes
 +
real    0m8.376s
 +
user    0m5.376s
 +
sys    0m2.952s
 +
 +
real    0m8.319s
 +
user    0m5.184s
 +
sys    0m3.096s
 +
 +
Unix Sockets
 +
real    0m9.469s
 +
user    0m5.840s
 +
sys    0m3.480s
 +
 +
real    0m9.364s
 +
user    0m5.500s
 +
sys    0m3.792s
 +
 +
</pre>
  
 
== Linux 2.6.18 VM ==
 
== Linux 2.6.18 VM ==

Revision as of 18:26, 13 August 2011

Here are some numbers on pipe() vs socketpair() performance. The sample program used either pipe() or socketpair() to create a set of file descriptors. The main thread sent 512MB of data through the fds and then closed the sending side. A receiving thread read all the data until EOF and then exited.


Mac OS X 10.6.8

Pipes
real    0m8.501s
user    0m5.751s
sys     0m4.185s

real    0m8.462s
user    0m5.721s
sys     0m4.078s

Unix Sockets
real    0m9.782s
user    0m6.329s
sys     0m7.301s

real    0m9.992s
user    0m6.360s
sys     0m7.417s

Linux 2.6.26-2-amd64

Pipes
real    0m8.376s
user    0m5.376s
sys     0m2.952s

real    0m8.319s
user    0m5.184s
sys     0m3.096s

Unix Sockets
real    0m9.469s
user    0m5.840s
sys     0m3.480s

real    0m9.364s
user    0m5.500s
sys     0m3.792s

Linux 2.6.18 VM

This benchmark only sent 51 MB of data because it was running in a VM.

Pipes
real	0m9.359s
user	0m2.377s
sys	0m1.603s

real	0m11.233s
user	0m2.253s
sys	0m2.345s

Unix Sockets
real	0m10.903s
user	0m2.178s
sys	0m2.380s

real	0m11.053s
user	0m2.280s
sys	0m2.422s