Skip to content

[ML] Reduce input stream buffer from 8KB to 2KB #1881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/api/CLengthEncodedInputParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ namespace ml {
namespace api {

// Initialise statics
const std::size_t CLengthEncodedInputParser::WORK_BUFFER_SIZE{8192}; // 8kB

// We keep the buffer at 2KB because it has to be smaller
// than the OS buffer for the named pipes (smallest is windows at 4KB).
// This allows flushing the buffer from the java side by sending spaces
// without the risk of blocking the thread that writes to the process.
const std::size_t CLengthEncodedInputParser::WORK_BUFFER_SIZE{2048}; // 2kB

CLengthEncodedInputParser::CLengthEncodedInputParser(std::istream& strmIn)
: CLengthEncodedInputParser{TStrVec{}, strmIn} {
Expand Down