-
Notifications
You must be signed in to change notification settings - Fork 9
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
Oplogtoredis: performance improvements by raw oplog processing #84
Conversation
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.
Nicely done. I'm excited to see the performance gains we get with this. I've left a couple of comments.
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.
looks good so far as I can tell by eye. testing will be key.
Oplogtoredis receives the oplog entries, unmarshals the metadata layer for filtering/sharding, then unmarshals the payload and constructs an object that is then marshalled into JSON.
This PR skips the payload unmarshalling, and instead extracts the needed values directly from the bson.Raw object, using the methods provided with https://pkg.go.dev/go.mongodb.org/mongo-driver/bson . This is expected to be much more CPU/memory efficient than the former intermediate step of unmarshalling to a go object.