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

Reuse postings and avoid fmt.Sprintf to reduce mem allocations #3767

Merged
merged 6 commits into from
Aug 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge master
  • Loading branch information
manishrjain committed Aug 7, 2019
commit be273cd99e28649042b4d76486e46a24594474e0
3 changes: 1 addition & 2 deletions dgraph/cmd/bulk/mapper.go
Original file line number Diff line number Diff line change
@@ -190,8 +190,7 @@ func (m *mapper) addMapEntry(key []byte, p *pb.Posting, shard int) {
atomic.AddInt64(&m.prog.mapEdgeCount, 1)

me := m.mePool.Get().(*pb.MapEntry)
*me = pb.MapEntry{}
me.Key = key
*me = pb.MapEntry{Key: key}

if p.PostingType != pb.Posting_REF || len(p.Facets) > 0 {
me.Posting = p
You are viewing a condensed version of this merge commit. You can view the full changes here.