Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Direct binary writes aren't asynchronous #2444

@roji

Description

@roji

When writing user-provided binary data, we have two cases:

  1. If the user data is small and fits in our write buffer, we copy it there just like any other value.
  2. If it's bigger than the buffer, we flush the buffer and then write the user data directly to the socket.

The logic is to minimize system calls/TCP packets for small user data, but bypass the internal buffer for larger data (saving the in-memory copying).

The direct write mechanism is currently implemented synchronously with no async option.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions