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

Worker: Return nil on error #5414

Merged
merged 5 commits into from
May 11, 2020
Merged

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented May 11, 2020

The following output from pprof shows that the pb.Result{} takes up a lot of memory. This PR tries to reduce the unnecessary allocation
From https://discuss.dgraph.io/t/optimize-dgraph-memory-usage/6665

(pprof) list processTask

         .     1.91GB    887:	out, err := qs.helpProcessTask(ctx, q, gid)
         .          .    888:	if err != nil {
    4.50MB     4.45GB    889:		return &pb.Result{}, err // Create this object once, use it repeatedly.
         .          .    890:	}
         .     4.97GB    891:	return out, nil
         .          .    892:}

This change is Reviewable

@jarifibrahim jarifibrahim changed the title [Experiment] Worker: Return nil on error Worker: Return nil on error May 11, 2020
@jarifibrahim jarifibrahim marked this pull request as ready for review May 11, 2020 14:00
@jarifibrahim jarifibrahim requested review from manishrjain, pawanrawal and a team as code owners May 11, 2020 14:00
Copy link
Contributor

@pawanrawal pawanrawal left a comment

Choose a reason for hiding this comment

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

:lgtm_strong:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain)

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@jarifibrahim jarifibrahim merged commit 5890a6c into master May 11, 2020
@jarifibrahim jarifibrahim deleted the ibrahim/fix-return-values-1 branch May 11, 2020 17:29
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 18, 2020
The following output from pprof shows that the `pb.Result{}` takes 
up a lot of memory. This PR tries to reduce the unnecessary allocation.
From https://discuss.dgraph.io/t/optimize-dgraph-memory-usage/6665
```
(pprof) list processTask

         .     1.91GB    887:	out, err := qs.helpProcessTask(ctx, q, gid)
         .          .    888:	if err != nil {
    4.50MB     4.45GB    889:		return &pb.Result{}, err
         .          .    890:	}
         .     4.97GB    891:	return out, nil
         .          .    892:}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants