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 message batch sending #612

Closed
wants to merge 1 commit into from
Closed

Add message batch sending #612

wants to merge 1 commit into from

Conversation

tzachshabtay
Copy link

Description

  • When queueing fix messages for sending, moved the notification channel sending to be out of the lock, this caused unneeded lock contention as the thread receiving for the channel was locking the same locking after receiving the message.
  • Added a method to send a batch of messages to the queue, which allows to reduce lock contention even more.


// queueBatchForSend will validate, persist, and queue a batch of messages for send.
func (s *session) queueBatchForSend(msgs []*Message) error {
s.queueBatchForSendLocked(msgs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs error handling here

Copy link
Author

Choose a reason for hiding this comment

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

Closing this PR, it didn't actually improve performance in our benchmarks

Copy link
Contributor

Choose a reason for hiding this comment

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

@tzachshabtay Can you try this one too with your benchmarks? #615

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