-
Notifications
You must be signed in to change notification settings - Fork 950
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
refactor: use raw system call instead of clone-and-read-from-stdout to boost GetKernelVersion. #2463
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2463 +/- ##
=========================================
Coverage ? 68.93%
=========================================
Files ? 277
Lines ? 18297
Branches ? 0
=========================================
Hits ? 12613
Misses ? 4256
Partials ? 1428
|
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.
@SimonCqk could you mind to rebase your commits into one and sign it off? thanks
e6aab7f
to
4ce6826
Compare
@fuweid sorry to trouble you, I've done that. |
LGTM also cc @allencloud |
…o boost GetKernelVersion. Signed-off-by: Simoncqk <cqk0100@gmail.com>
// BenchmarkGetUnameByUnix-4 200000 10584 ns/op | ||
// BenchmarkGetUnameByExecRun-4 200 6255530 ns/op | ||
|
||
// Benchmark for executing `uname` by raw unix system call |
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.
Just asking, how long this two Benchmark case execute?
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.
LGTM |
Signed-off-by: Simoncqk cqk0100@gmail.com
Ⅰ. Describe what this PR did
refactor: use raw system call instead of clone-and-read-from-stdout to boost GetKernelVersion. Original
exec.Run
cloned a new process which caused performance hot spot.Ⅱ. Does this pull request fix one issue?
fixes#2459
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
kernel_test.go has covered this case.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews