-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use pre-allocated protobufs during backups. #5404
Conversation
Backups convert the values stored in disk into an intermediate format (for backwards compatibility reasons). This creates a lot of pb.PostingList and pb.BackupPostingList objects that are discarded almost immediatly. Using a sync.Pool to allocate these objects should reduce the amount of memory that is allocated during a backup.
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.
Reviewed 5 of 5 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @martinmr and @vvbalaji-dgraph)
worker/backup_processor.go, line 298 at r1 (raw file):
pl := pr.plList[threadNum] bpl := pr.bplList[threadNum] defer func() {
Remove defer here. Do the reset upfront.
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.
Reviewable status: 1 of 5 files reviewed, 1 unresolved discussion (waiting on @manishrjain and @vvbalaji-dgraph)
worker/backup_processor.go, line 298 at r1 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
Remove defer here. Do the reset upfront.
Done.
Backups convert the values stored in disk into an intermediate format (for backwards compatibility reasons). This creates a lot of pb.PostingList and pb.BackupPostingList objects that are discarded almost immediatly. Using preallocated protobufs (one per thread used by the stream object) should avoid these allocations altogether. Fixes DGRAPH-1312
Backups convert the values stored in disk into an intermediate format (for backwards compatibility reasons). This creates a lot of pb.PostingList and pb.BackupPostingList objects that are discarded almost immediatly. Using preallocated protobufs (one per thread used by the stream object) should avoid these allocations altogether. Fixes DGRAPH-1312
Backups convert the values stored in disk into an intermediate format
(for backwards compatibility reasons). This creates a lot of
pb.PostingList and pb.BackupPostingList objects that are discarded
almost immediately. Using preallocated protobufs (one per thread used by
the stream object) should avoid these allocations altogether.
Fixes DGRAPH-1312
This change is
Docs Preview: