Skip to content

Improve performance when reading stdin

Herbert Xu dash 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 0 repliesNew
  2. v23 patches 0 repliesSuperseded
  3. v13 patches 0 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3input: Move newline loop into preadbuffersrc/input.c+31 -160 replies
2/3input: Use lseek on stdin when possiblesrc/eval.c src/init.h src/input.c +6 more+111 -430 replies
3/3input: Use tee(2) for stdin pipeconfigure.ac src/input.c src/system.h+72 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [v3 PATCH 0/3] Improve performance when reading stdin

v3 rebases on multibyte patch-set v5.

The performance when reading stdin has regressed after we started reading one byte at a time. This patch series uses lseek(2) and tee(2) to recover performance where possible.

Herbert Xu (3):
input: Move newline loop into preadbuffer
input: Use lseek on stdin when possible
input: Use tee(2) for stdin pipe

 configure.ac  |   2 +-
 src/eval.c    |   3 +
 src/init.h    |   1 +
 src/input.c   | 208 +++++++++++++++++++++++++++++++++++++++-----------
 src/input.h   |   4 +
 src/jobs.c    |   3 +
 src/mkinit.c  |   6 ++
 src/options.c |   2 +-
 src/redir.c   |  26 ++++---
 src/system.h  |   7 ++
 src/trap.c    |   1 +
 11 files changed, 205 insertions(+), 58 deletions(-)
Signature · 1 line
2.39.2