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

Added batch write buffer #50

Merged
merged 6 commits into from
Mar 18, 2024
Merged

Added batch write buffer #50

merged 6 commits into from
Mar 18, 2024

Conversation

mtmk
Copy link
Contributor

@mtmk mtmk commented Mar 15, 2024

  • Changed publish to be async
  • Added BatchBuffer to improve write performance

Tests below were run against nats bench:

nats bench x --sub 1 --msgs 1000000

nats bench

nats bench x --pub 1 --msgs 1000000

Sub stats: 1,457,860 msgs/sec ~ 177.96 MB/sec

with batch

swift run -c release bench pub x 1000000

Sub stats: 148,782 msgs/sec ~ 18.16 MB/sec

with batch disabled

swift run -c release -Xswiftc -DSWIFT_NATS_BATCH_BUFFER_DISABLED bench pub x 1000000

Sub stats: 18,998 msgs/sec ~ 2.32 MB/sec

@mtmk mtmk marked this pull request as ready for review March 15, 2024 14:06
@mtmk mtmk requested review from piotrpio and Jarema March 15, 2024 14:06
Copy link
Contributor

@piotrpio piotrpio left a comment

Choose a reason for hiding this comment

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

LGTM!

@Jarema Jarema merged commit 381395a into main Mar 18, 2024
1 check passed
@Jarema Jarema deleted the add-write-buffer branch March 18, 2024 08:43
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.

None yet

3 participants