Skip to content

Conversation

@sylvestre
Copy link
Contributor

after #8439

With:
dd if=/dev/zero bs=1M count=100 | tr '\0' 'x' > 100mb_input

hyperfine --export-markdown tr.md --warmup 3 \
    '/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'
Benchmark 1: /usr/bin/tr a b < 100mb_input > /dev/null
  Time (mean ± σ):      46.4 ms ±   5.4 ms    [User: 32.4 ms, System: 14.0 ms]
  Range (min … max):    40.2 ms …  63.9 ms    66 runs
 
Benchmark 2: ./target/release/tr a b < 100mb_input > /dev/null
  Time (mean ± σ):      29.3 ms ±   6.6 ms    [User: 14.0 ms, System: 15.2 ms]
  Range (min … max):    21.1 ms …  59.1 ms    91 runs
 
Benchmark 3: ./target/release/tr.previous a b < 100mb_input > /dev/null
  Time (mean ± σ):      85.0 ms ±   3.7 ms    [User: 71.9 ms, System: 13.0 ms]
  Range (min … max):    80.6 ms …  93.3 ms    34 runs
 
Summary
  ./target/release/tr a b < 100mb_input > /dev/null ran
    1.58 ± 0.40 times faster than /usr/bin/tr a b < 100mb_input > /dev/null
    2.90 ± 0.67 times faster than ./target/release/tr.previous a b < 100mb_input > /dev/null
Command Mean [ms] Min [ms] Max [ms] Relative
/usr/bin/tr a b < 100mb_input > /dev/null 46.4 ± 5.4 40.2 63.9 1.58 ± 0.40
./target/release/tr a b < 100mb_input > /dev/null 29.3 ± 6.6 21.1 59.1 1.00
./target/release/tr.previous a b < 100mb_input > /dev/null 85.0 ± 3.7 80.6 93.3 2.90 ± 0.67

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre requested a review from cakebaker August 13, 2025 19:01
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

Comment on lines 31 to 37
pub fn process_single_char_operation<F>(
input: &[u8],
output: &mut Vec<u8>,
target_char: u8,
transform: F,
) where
F: Fn(u8) -> u8,
Copy link
Contributor

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.

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre force-pushed the tr-perf-simd branch 2 times, most recently from b3a4985 to 91cd963 Compare August 16, 2025 21:04
@sylvestre sylvestre marked this pull request as draft August 16, 2025 21:04
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre marked this pull request as ready for review August 20, 2025 10:44
@cakebaker cakebaker merged commit ab1958e into uutils:main Aug 20, 2025
92 checks passed
@sylvestre sylvestre deleted the tr-perf-simd branch August 20, 2025 11:46
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