Skip to content
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

Refactor to parse Mongo messages from buffer #41

Merged
merged 5 commits into from
Sep 2, 2024
Merged

Conversation

mpihlak
Copy link
Owner

@mpihlak mpihlak commented Aug 29, 2024

This reduces memory allocations by using a single read buffer for the duration of the connection. Actually two buffers -- one from reading from client and another from server. Tracker is refactored to take already parsed Mongo message, thus avoiding the need to ship the whole buffer over to another task.

Also the following cleanups were applied:

  • Remove async streaming support in async-bson - now it assumes that it always has the full buffer to parse.
  • Remove the abandoned WASM experiment.

@mpihlak mpihlak force-pushed the refactor-to-buffer branch from 0208831 to 48046b4 Compare August 29, 2024 19:46
This removes the small allocations on reading from the network that
eventually lead to high memory usage in the proxy.
In theory the async streaming parser could offer better memory usage,
but not having it results in easier to maintain code (no is_sync,
maybe_async, async recursion madness etc.). Good riddance.
@mpihlak mpihlak merged commit e52162f into master Sep 2, 2024
@mpihlak mpihlak deleted the refactor-to-buffer branch September 2, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant