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

optimization change to send outbound messages quicker #566

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

aricart
Copy link
Member

@aricart aricart commented Aug 15, 2023

change to queueMicrotask() instead of scheduling a timer for flushing - also made flush() do its work inline rather than scheduling a timer. The original node nats library performed a setImmediate(), which is not available in other runtimes.

The performance change for deno is about 7% improvement; on node the performance is up by 1200%

FIX https://github.com/nats-io/nats.js/issues/581
FIX https://github.com/nats-io/nats.js/issues/438

… also made flush() do its work inline, rather than scheduling a timer.
@aricart aricart marked this pull request as draft August 15, 2023 20:39
@aricart aricart marked this pull request as ready for review August 15, 2023 21:37
@aricart aricart requested a review from Jarema August 15, 2023 21:38
@aricart aricart temporarily deployed to CI August 15, 2023 21:40 — with GitHub Actions Inactive
@aricart aricart mentioned this pull request Aug 15, 2023
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants