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

Add "small message" net fallback #36

Closed
wants to merge 2 commits into from

Conversation

brandonsturgeon
Copy link
Member

@brandonsturgeon brandonsturgeon commented May 27, 2023

After our latest performance tests, it became clear that Express performs poorly for small messages.
But we already knew that, Express wasn't made to send small messages - no big surprise.

Well, based on our current per-key storage metrics, people are sending tons very small messages using Express. Unfortunately with messages this small, their experience will be exclusively worse than if they had just used a net message.

The performance tests highlighted another important thing: Express is only worse for messages that require 3 or fewer net messages.

This is interesting. If we look at both the usage metrics and the performance results, we find a cheap way to improve Express.

I don't necessarily want to make a pure-net data sender, but we could pretty easily cover the situation where a message could fit into a single net message.

That's what this PR does; it redirects small message payloads through the net library instead of the Express API, while still behaving the same way (calling receivers, respecting preDl receivers handling proofs, etc.).

I want to take this opportunity to refactor a few things and slim down the code, so the diff will be large but the functional changes will be few.

I also need to decide what to use as the id for these "small" messages in the callback chain. (some callbacks want the item ID). I don't want to introduce a regression, but I also don't want to write any worse code...

@brandonsturgeon brandonsturgeon added the enhancement New feature or request label May 27, 2023
@brandonsturgeon brandonsturgeon self-assigned this May 27, 2023
@brandonsturgeon
Copy link
Member Author

This will be addressed in #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant