Skip to content

Optimize on linux#11

Merged
struCoder merged 2 commits intostruCoder:masterfrom
hungrybirder:optimize_on_linux
Jun 2, 2021
Merged

Optimize on linux#11
struCoder merged 2 commits intostruCoder:masterfrom
hungrybirder:optimize_on_linux

Conversation

@hungrybirder
Copy link
Copy Markdown
Contributor

Hi @struCoder
I just make a little bit optimization for linux platform.
Please check it out.
Thank you.

GetStat function benchmark results

Before optimize
$ go clean -testcache && go test -test.v -bench=BenchmarkGetStat
goos: linux
goarch: amd64
pkg: github.com/struCoder/pidusage
BenchmarkGetStat
BenchmarkGetStat-12             470       2690727 ns/op
PASS
ok      github.com/struCoder/pidusage    1.533s

After optimize
$ go clean -testcache && go test -test.v -bench=BenchmarkGetStat
goos: linux
goarch: amd64
pkg: github.com/struCoder/pidusage
BenchmarkGetStat
BenchmarkGetStat-12           28416         36234 ns/op
PASS
ok      github.com/struCoder/pidusage    1.472s
@struCoder
Copy link
Copy Markdown
Owner

@hungrybirder
Nice PR !
Thanks :)

@struCoder struCoder merged commit 37c8929 into struCoder:master Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants