-
Notifications
You must be signed in to change notification settings - Fork 293
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
Support batching outgoing messages #576
base: main
Are you sure you want to change the base?
Conversation
Posting some load testing results using local Postgres: Output:
Note that this is much faster compare to existing implementation (#555) which takes 1.5 SECONDS to prepare 1000 messages for sending. Source code:
|
@Yu-Xie if you would change |
Makes sense -- I have addressed these feedbacks in #599 |
for _, mb := range msgBytes { | ||
s.toSend = append(s.toSend, mb) | ||
select { | ||
case s.messageEvent <- true: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be moved out of the loop as we don't release the lock until we return so it is not very useful to notify each time
Prototype for #555
func SaveMessagesAndIncrNextSenderMsgSeqNum(seqNum int, msg [][]byte)
in the storage interface, and then afunc SendAppToTarget(m []Messagable, sessionID SessionID) error
inregistry.go
to expose it.