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

benchmark: add --benchmem flag to benchmark command #2432

Closed
n10v opened this issue Sep 11, 2016 · 4 comments · Fixed by #2698
Closed

benchmark: add --benchmem flag to benchmark command #2432

n10v opened this issue Sep 11, 2016 · 4 comments · Fixed by #2698
Labels

Comments

@n10v
Copy link
Contributor

n10v commented Sep 11, 2016

I want to see, how many memory hugo consumes in the same way as go test -bench=. --benchmem do.

@bep bep closed this as completed Sep 11, 2016
@n10v
Copy link
Contributor Author

n10v commented Sep 11, 2016

But it's not the question, it's feature request: it would be great to add --benchmem flag to benchmark command🙏

@bep bep reopened this Sep 11, 2016
@bep
Copy link
Member

bep commented Sep 11, 2016

Yes, we should maybe refit that command to a Go benchmark ...

Also see https://github.com/bep/hugo-benchmark

@n10v
Copy link
Contributor Author

n10v commented Sep 11, 2016

I think, it could be implemented like that:

var mem runtime.MemStats
runtime.ReadMemStats(&mem)
before := mem.Alloc
// operations...
runtime.ReadMemStats(&mem)
after := mem.Alloc

memUsage := after - before
// print memUsage

n10v added a commit to n10v/hugo that referenced this issue Nov 17, 2016
* Add information about average time, memory consumption and
allocations.
* Fix situation, when user provides memprofile and cpuprofile, but
cpuprofile will not created.

Fixes gohugoio#2432
@bep bep closed this as completed in #2698 Nov 18, 2016
bep pushed a commit that referenced this issue Nov 18, 2016
* Add information about average time, memory consumption and
allocations.
* Fix situation, when user provides memprofile and cpuprofile, but
cpuprofile will not created.

Fixes #2432
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants