summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-06-13 21:13:25 +0200
committerMattias Andrée <maandree@kth.se>2017-06-13 21:13:25 +0200
commit0751b41ab058f177e65e0a5c57ea0557e8235d93 (patch)
treeff222db89d2c333f0e5f37d4d975db61bea435cf
parentm (diff)
downloadpipes-are-slow-0751b41ab058f177e65e0a5c57ea0557e8235d93.tar.gz
pipes-are-slow-0751b41ab058f177e65e0a5c57ea0557e8235d93.tar.bz2
pipes-are-slow-0751b41ab058f177e65e0a5c57ea0557e8235d93.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--README.md11
-rw-r--r--bench.c8
2 files changed, 14 insertions, 5 deletions
diff --git a/README.md b/README.md
index 8567d23..af8a763 100644
--- a/README.md
+++ b/README.md
@@ -2,11 +2,12 @@ Despite unix(7) offering much more features than pipe(7),
it is much faster. There is however two features unix(7)
does not have: there is no guarantee that small writes are
atomic, there is not support for splice(2)/tee(2) which
-is extremely efficient, and file descriptor hijacking is
-not support. The latter is a double-sided sword: it [the
-lack of support] increases security, but other processes'
-file cannot be opened and programs must treat /dev/fd/
-paths especially.
+is extremely efficient, vmsplice(2) and changing the
+capacity (neither of which improves the performance
+sufficiently), and file descriptor hijacking is not support.
+The latter is a double-sided sword: it [the lack of support]
+increases security, but other processes' file cannot be
+opened and programs must treat /dev/fd/ paths especially.
![performance graph](graph.png)
diff --git a/bench.c b/bench.c
index 8e0f091..abf2be8 100644
--- a/bench.c
+++ b/bench.c
@@ -61,6 +61,10 @@ main(void)
}
pipe(rw);
+#if 0
+ if (fcntl(*rw, F_SETPIPE_SZ, 1 << 20) < 0)
+ return perror("fcntl F_SETPIPE_SZ"), 1;
+#endif
if (!fork()) {
close(rw[1]);
while (read(rw[0], buf, n) > 0);
@@ -79,6 +83,10 @@ main(void)
}
pipe(rw);
+#if 0
+ if (fcntl(*rw, F_SETPIPE_SZ, 1 << 20) < 0)
+ return perror("fcntl F_SETPIPE_SZ"), 1;
+#endif
if (!fork()) {
close(rw[1]);
while (read(rw[0], buf, n) > 0);