MatrixAI / js-quic

QUIC Networking for TypeScript & JavaScript
https://matrixai.github.io/js-quic/
Apache License 2.0
13 stars 1 forks source link

Reduce read buffer size for `QUICStream` #83

Closed tegefaulkes closed 7 months ago

tegefaulkes commented 7 months ago

Specification

Right now each QUICStream has a single buffer used to read data out of quiche. The size of this is set using a constant value from quiche of about 1mb. As a result each QUICStream reserves 1MB of memory for it's lifespan. That is far too much memory to be used especially when we have multiple active connections going on.

The solution is to reduce this to a few KB at most. If it's not already it should be a configured value as well when creating a client or server.

Additional context

Related: #65 - Original approach to solving the problem but it was not appropriate.

Tasks

  1. Reduce the buffer used by each QUICStream for reading data out of quiche
  2. If it still needs to be done, this value needs to be set on construction of the QUICStream and by extension anything that creates a QUICStream.