From 289db974cdf924b070e72d8559d8bc8679b6972b Mon Sep 17 00:00:00 2001 From: Avril Date: Sat, 21 May 2022 04:26:21 +0100 Subject: [PATCH] TODO: Find out how to set the length of stdout if possible, so that the consumer of `collect` in a pipeline need only use one syscall splice() to read all the collected data at once, like a file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for collect's current commit: Curse − 凶 --- .gitignore | 1 + TODO | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d9a10ac..4e4df06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target +/perf *~ # Profiling diff --git a/TODO b/TODO index d16b5dd..68794ac 100644 --- a/TODO +++ b/TODO @@ -1,2 +1,8 @@ -TODO: Is there a way we can set the size of `stdout` before exiting? -TODO: I dunno what `sealing` is, but maybe that can be used? Or, if not, a specific `fcntl()` call? Finding this out will allow consumers of `collect`'s output to use a single `splice()` instead of many, greatly improving its performance in pipelines as its output can be used like an actual file's... +From `strace` examinations, far fewer `splice()/send_file()` are used from the consumer of a `collect` in the middle of a pipe. +A reduction of over 5 times. But still not just a single one. + +# TODO: single syscall reads from consumers of `collect` in pipelines +Is there a way we can set the size of `stdout` before exiting? +I dunno what `sealing` is, but maybe that can be used? Or, if not, a specific `fcntl()` call? Finding this out will allow consumers of `collect`'s output to use a single `splice()` instead of many, greatly improving its performance in pipelines as its output can be used like an actual file's... + +