diff options
author | Kevin Cherkauer <kevin.cherkauer@mongodb.com> | 2022-11-17 00:43:22 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-11-17 01:15:34 +0000 |
commit | 3fdd9c6c3e71e9be3478f840afab8eea93c2061c (patch) | |
tree | 8c02b1d2ff9d1ebf3ca958160f099790a5d40007 /src/mongo/db/storage/named_pipe_posix.cpp | |
parent | 6b46d34b665f34e7c0d4794d0f8964aa9e36b289 (diff) | |
download | mongo-3fdd9c6c3e71e9be3478f840afab8eea93c2061c.tar.gz |
SERVER-70392 Named Pipes _writeTestPipe shell function
Diffstat (limited to 'src/mongo/db/storage/named_pipe_posix.cpp')
-rw-r--r-- | src/mongo/db/storage/named_pipe_posix.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/db/storage/named_pipe_posix.cpp b/src/mongo/db/storage/named_pipe_posix.cpp index 624c72b1db8..cf940dfe5e7 100644 --- a/src/mongo/db/storage/named_pipe_posix.cpp +++ b/src/mongo/db/storage/named_pipe_posix.cpp @@ -28,7 +28,8 @@ */ #ifndef _WIN32 -#include "named_pipe.h" + +#include "mongo/db/storage/named_pipe.h" #include <fmt/format.h> #include <string> @@ -91,6 +92,14 @@ NamedPipeInput::~NamedPipeInput() { } void NamedPipeInput::doOpen() { + // MultiBsonStreamCursor's (MBSC) assembly buffer is designed to perform well without a lower- + // layer IO buffer. Removing std::ifstream's default 8k "associated buffer" improves throughput + // by 1.9% by eliminating the hidden copies from that buffer to MBSC's buffer. MBSC itself will + // never copy data except when it (rarely) needs to expand its buffer, so by removing + // std::ifstream's buffer we get an essentially zero-copy cursor that still avoids lots of tiny + // IOs due to MBSC's assembly buffer algorithm. + _ifs.rdbuf()->pubsetbuf(0, 0); + // Retry open every 1 ms for up to 1 sec in case writer has not created the pipe yet. int retries = 0; do { |