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

Set S2 writer concurrency to 1 #4570

Merged
merged 1 commit into from Sep 25, 2023
Merged

Set S2 writer concurrency to 1 #4570

merged 1 commit into from Sep 25, 2023

Conversation

neilalexander
Copy link
Member

By default the S2 library defaults to a concurrency level of GOMAXPROCS, which forces the library to run extra goroutines to manage asynchronous flushes.

As we only ever have one goroutine (the client writer) using a given S2 writer, reducing the concurrency down to 1 helps a bit with overheads, slightly reduces allocations and slightly improves throughput.

Signed-off-by: Neil Twigg neil@nats.io

@neilalexander neilalexander requested a review from a team as a code owner September 21, 2023 15:34
Signed-off-by: Neil Twigg <neil@nats.io>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

Let's add option in separate PR for folks to control that as well.

@neilalexander neilalexander merged commit 33d8de7 into main Sep 25, 2023
2 checks passed
@neilalexander neilalexander deleted the neil/s2concurrency branch September 25, 2023 15:28
@neilalexander neilalexander self-assigned this Oct 3, 2023
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

2 participants