-
Type: Spec Change
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Connection Layer, Performance, Wire Protocol
Use Case
As a driver engineer,
I want to remove unnecessary buffer concatenation in our wire protocol abstraction,
So that we remove unnecessary buffer allocations.
Wire protocol messages in the Node driver implement a `toBin()` method that returns a serialized wire protocol message. `toBin()` returns an array of Uint8Arrays. The message stream ( and the forthcoming new connection layer ) call `toBin()` and then concatenate the buffers before writing this to the socket.
The socket write api accepts a buffer - there's no reason we can't just write each buffer returned by `toBin()` to the socket directly. We should remove the unnecessary `Buffer.concat` calls and write each chunk to the socket directly.
User Impact
- n/a
Dependencies
- n/a
Unknowns
Acceptance Criteria
Implementation Requirements
- In the message stream, when a wire protocol message is serialized, change the logic to write each buffer sequentially instead of concatenating them into a buffer and writing the concatenated buffer
Testing Requirements
- ensure existing tests pass
Documentation Requirements
- none
Follow Up Requirements
- none