-
Notifications
You must be signed in to change notification settings - Fork 29
pgrep: Add command pgrep
#95
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #95 +/- ##
==========================================
+ Coverage 45.95% 51.99% +6.04%
==========================================
Files 18 21 +3
Lines 2298 2652 +354
Branches 332 403 +71
==========================================
+ Hits 1056 1379 +323
- Misses 1066 1145 +79
+ Partials 176 128 -48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
regex is too slow, need to write algorithm for parsing /proc/self/stat # Uutils implementation
./pgrep -o 0.55s user 0.01s system 99% cpu 0.561 total
./pgrep -n 0.50s user 0.02s system 99% cpu 0.522 total
# GNU implementation
pgrep -o 0.02s user 0.00s system 95% cpu 0.022 total
pgrep -n 0.00s user 0.02s system 94% cpu 0.017 total |
after rewrite algorithm
|
for benchmarking, you should use hyperfine :) |
I came up with a better idea, I think make the |
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.
A general feedback: please add more tests :)
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.
A review of pgrep.rs
hopefully follows tomorrow.
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.
Small suggestion. I think @cakebaker is better equipped to do a review. Happy to help out more if you need it!
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.
With the exception of the two function names it looks good.
Good work :) |
fix #26