Commit Graph

4 Commits (6fd1035fb1fb0a40f703f943b62ddafb4fc5226a)

Author SHA1 Message Date
Samuel Mannehed 472ede66ea Standardize on camelCase in Websock 4 years ago
Samuel Mannehed da228af778 Standardize on camelCase in tests 4 years ago
Jesper Alf Dam 09de4b8349 Don't compact the receive buffer unless we've actually run out of space
Previously, we would compact the buffer (moving unread data to the
start of the buffer) as follows:

- after processing a message, if there are zero unread bytes, just reset
  the indices for first and last unread byte to zero
- else, if at least 1/8th of the buffer is used, copy remaining data to the beginning of the buffer

The second option is never actually necessary, as before inserting new data
into the array, we already check if there's enough free space, and
compact the buffer first if necessary. So we've been doing a lot of
copies that weren't actually needed. Let's not do that any more.
4 years ago
matt 408c005d3e Initial commit 5 years ago