-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
tr: refactor and introduce simd to get important perf win #8471
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
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
src/uu/tr/src/simd.rs
Outdated
| pub fn process_single_char_operation<F>( | ||
| input: &[u8], | ||
| output: &mut Vec<u8>, | ||
| target_char: u8, | ||
| transform: F, | ||
| ) where | ||
| F: Fn(u8) -> u8, |
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.
Is transform necessary? This function is called only by TranslateOperation and thus it might make sense to adapt the function for this single use case, similar to process_single_delete and DeleteOperation.
|
GNU testsuite comparison: |
b3a4985 to
91cd963
Compare
|
GNU testsuite comparison: |
91cd963 to
1bcaea3
Compare
|
GNU testsuite comparison: |
after #8439
With:
dd if=/dev/zero bs=1M count=100 | tr '\0' 'x' > 100mb_input/usr/bin/tr a b < 100mb_input > /dev/null./target/release/tr a b < 100mb_input > /dev/null./target/release/tr.previous a b < 100mb_input > /dev/null