Skip to content

build: set release profile optimization level to 's'#12088

Closed
xtqqczze wants to merge 1 commit intouutils:mainfrom
xtqqczze:opt-level
Closed

build: set release profile optimization level to 's'#12088
xtqqczze wants to merge 1 commit intouutils:mainfrom
xtqqczze:opt-level

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

@xtqqczze xtqqczze commented Apr 30, 2026

s: optimize for binary size

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cut/bounded-memory is now passing!
Congrats! The gnu test tests/printf/printf-surprise is now passing!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 30, 2026

Merging this PR will degrade performance by 99.09%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
❌ 110 regressed benchmarks
✅ 197 untouched benchmarks
⏩ 46 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation wc_words_synthetic[2000] 11.4 s 12.6 s -9.35%
Simulation wc_lines_large_line_count[500000] 2.6 ms 3.4 ms -22.45%
Simulation wc_default_large_line_count[100000] 50.3 ms 57.5 ms -12.51%
Simulation wc_words_large_line_count[100000] 47.9 ms 52.7 ms -9.15%
Simulation wc_bytes_lines_synthetic[2000] 120.8 ms 157.7 ms -23.38%
Simulation wc_chars_large_line_count[100000] 713.4 µs 866.5 µs -17.68%
Simulation wc_lines_variable_length[(50, 500)] 3.2 ms 4.1 ms -22.61%
Simulation wc_lines_extreme_line_lengths[(100000, 200)] 1.4 ms 1.8 ms -20.69%
Simulation cksum_crc32b 13.7 ms 33.4 ms -59.16%
Simulation cksum_default 16.7 ms 33.5 ms -50.19%
Simulation cksum_sha224 1.8 s 2.7 s -33.28%
Simulation cksum_md5 320.9 ms 399.2 ms -19.62%
Simulation cksum_sha256 1.8 s 2.7 s -33.28%
Simulation cksum_sha384 1,110.6 ms 969.2 ms +14.59%
Simulation cksum_sha1 718.3 ms 1,638.3 ms -56.15%
Simulation cksum_raw_output 16.7 ms 33.5 ms -50.04%
Simulation cksum_sha2 1.8 s 2.7 s -33.28%
Simulation cksum_sysv 48.1 ms 175.5 ms -72.6%
Simulation cksum_multiple_files 25.1 ms 50.2 ms -49.97%
Simulation cksum_bsd 128.1 ms 204.6 ms -37.39%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Comparing xtqqczze:opt-level (cd1349b) with main (5316f58)

Open in CodSpeed

Footnotes

  1. 46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@xtqqczze xtqqczze closed this Apr 30, 2026
@github-actions
Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 130.25 MB (-21.03 MB, -13.90%)

Significant per-binary changes:
  pr            2.83 MB ->    2.37 MB  (-472 KB, -16.28%)
  ptx           2.57 MB ->    2.18 MB  (-408 KB, -15.48%)
  dir           2.08 MB ->    1.69 MB  (-400 KB, -18.76%)
  vdir          2.08 MB ->    1.69 MB  (-400 KB, -18.76%)
  csplit        2.52 MB ->    2.13 MB  (-396 KB, -15.37%)
  ls            2.08 MB ->    1.69 MB  (-396 KB, -18.61%)
  tac           2.49 MB ->    2.10 MB  (-396 KB, -15.54%)
  nl            2.49 MB ->    2.11 MB  (-392 KB, -15.36%)
  sort          3.08 MB ->    2.71 MB  (-372 KB, -11.80%)
  date          2.72 MB ->    2.41 MB  (-316 KB, -11.33%)
  du            1.67 MB ->    1.37 MB  (-312 KB, -18.22%)
  touch         1.58 MB ->    1.31 MB  (-272 KB, -16.83%)
  tail          1.57 MB ->    1.32 MB  (-264 KB, -16.38%)
  cp            1.52 MB ->    1.27 MB  (-252 KB, -16.24%)
  stat          1.52 MB ->    1.27 MB  (-252 KB, -16.24%)
  uptime        1.44 MB ->    1.20 MB  (-244 KB, -16.53%)
  mv            1.39 MB ->    1.17 MB  (-228 KB, -16.01%)
  expr          2.78 MB ->    2.56 MB  (-224 KB, -7.88%)
  join          2.46 MB ->    2.24 MB  (-224 KB, -8.90%)
  cksum         2.16 MB ->    1.95 MB  (-220 KB, -9.93%)
  basenc        1.27 MB ->    1.06 MB  (-212 KB, -16.31%)
  factor        1.39 MB ->    1.19 MB  (-212 KB, -14.85%)
  rm            1.29 MB ->    1.08 MB  (-212 KB, -16.06%)
  md5sum        2.12 MB ->    1.92 MB  (-208 KB, -9.58%)
  printf        1.34 MB ->    1.14 MB  (-208 KB, -15.16%)
  sha1sum       2.12 MB ->    1.92 MB  (-208 KB, -9.58%)
  sha224sum     2.12 MB ->    1.92 MB  (-208 KB, -9.58%)
  sha256sum     2.12 MB ->    1.92 MB  (-208 KB, -9.58%)
  sha384sum     2.12 MB ->    1.92 MB  (-208 KB, -9.58%)
  sha512sum     2.12 MB ->    1.92 MB  (-208 KB, -9.58%)
  b2sum         2.12 MB ->    1.92 MB  (-204 KB, -9.39%)
  base32        1.23 MB ->    1.03 MB  (-204 KB, -16.19%)
  df            1.27 MB ->    1.07 MB  (-204 KB, -15.74%)
  split         1.29 MB ->    1.09 MB  (-204 KB, -15.41%)
  numfmt        1.32 MB ->    1.12 MB  (-200 KB, -14.84%)
  pinky         1.21 MB ->    1.02 MB  (-196 KB, -15.81%)
  wc            1.27 MB ->    1.08 MB  (-196 KB, -15.08%)
  who           1.22 MB ->    1.03 MB  (-196 KB, -15.71%)
  env           1.29 MB ->    1.10 MB  (-192 KB, -14.59%)
  head          1.21 MB ->    1.03 MB  (-192 KB, -15.43%)
  install       1.27 MB ->    1.09 MB  (-192 KB, -14.72%)
  od            1.26 MB ->    1.07 MB  (-192 KB, -14.86%)
  seq           1.31 MB ->    1.12 MB  (-192 KB, -14.29%)
  more          1.26 MB ->    1.08 MB  (-188 KB, -14.55%)
  shred         1.20 MB ->    1.02 MB  (-184 KB, -15.03%)
  timeout       1.29 MB ->    1.11 MB  (-184 KB, -13.90%)
  chgrp         1.18 MB ->    1.00 MB  (-180 KB, -14.95%)
  chown         1.18 MB ->    1.00 MB  (-180 KB, -14.90%)
  cut           1.18 MB ->    1.00 MB  (-180 KB, -14.95%)
  id            1.16 MB ->    1004 KB  (-180 KB, -15.20%)
  ln            1.19 MB ->    1.02 MB  (-180 KB, -14.75%)
  stdbuf        1.19 MB ->    1.02 MB  (-176 KB, -14.47%)
  tr            1.19 MB ->    1.02 MB  (-176 KB, -14.47%)
  base64        1.16 MB ->    1012 KB  (-172 KB, -14.53%)
  chmod         1.16 MB ->    1020 KB  (-172 KB, -14.43%)
  chroot        1.19 MB ->    1.02 MB  (-172 KB, -14.14%)
  sleep         1.21 MB ->    1.05 MB  (-172 KB, -13.83%)
  truncate      1.15 MB ->    1008 KB  (-172 KB, -14.58%)
  tsort         1.15 MB ->    1004 KB  (-172 KB, -14.63%)
  uniq          1.18 MB ->    1.01 MB  (-172 KB, -14.29%)
  dircolors     1.18 MB ->    1.01 MB  (-168 KB, -13.95%)
  fmt           1.17 MB ->    1.00 MB  (-168 KB, -14.05%)
  mkdir         1.14 MB ->    1004 KB  (-168 KB, -14.33%)
  realpath      1.14 MB ->     996 KB  (-168 KB, -14.43%)
  shuf          1.18 MB ->    1.01 MB  (-168 KB, -13.95%)
  stty          1.17 MB ->    1.00 MB  (-168 KB, -14.05%)
  unexpand      1.14 MB ->     996 KB  (-168 KB, -14.43%)
  [             1.12 MB ->     988 KB  (-164 KB, -14.24%)
  comm          1.14 MB ->    1000 KB  (-164 KB, -14.09%)
  dd            1.33 MB ->    1.17 MB  (-164 KB, -12.06%)
  fold          1.14 MB ->    1004 KB  (-164 KB, -14.04%)
  hostname      1.12 MB ->     988 KB  (-164 KB, -14.24%)
  kill          1.14 MB ->    1008 KB  (-164 KB, -13.99%)
  mktemp        1.15 MB ->    1012 KB  (-164 KB, -13.95%)
  nice          1.14 MB ->    1004 KB  (-164 KB, -14.04%)
  nohup         1.14 MB ->    1008 KB  (-164 KB, -13.99%)
  readlink      1.13 MB ->     992 KB  (-164 KB, -14.19%)
  rmdir         1.12 MB ->     984 KB  (-164 KB, -14.29%)
  test          1.12 MB ->     988 KB  (-164 KB, -14.24%)
  basename      1.11 MB ->     972 KB  (-160 KB, -14.13%)
  cat           1.13 MB ->    1000 KB  (-160 KB, -13.79%)
  expand        1.14 MB ->    1008 KB  (-160 KB, -13.70%)
  groups        1.11 MB ->     976 KB  (-160 KB, -14.08%)
  link          1.10 MB ->     968 KB  (-160 KB, -14.18%)
  mkfifo        1.12 MB ->     984 KB  (-160 KB, -13.99%)
  mknod         1.12 MB ->     992 KB  (-160 KB, -13.89%)
  nproc         1.11 MB ->     980 KB  (-160 KB, -14.04%)
  paste         1.13 MB ->     996 KB  (-160 KB, -13.84%)
  pathchk       1.11 MB ->     980 KB  (-160 KB, -14.04%)
  sum           1.12 MB ->     992 KB  (-160 KB, -13.89%)
  sync          1.14 MB ->    1004 KB  (-160 KB, -13.75%)
  tee           1.13 MB ->     996 KB  (-160 KB, -13.84%)
  uname         1.11 MB ->     972 KB  (-160 KB, -14.13%)
  printenv      1.10 MB ->     972 KB  (-156 KB, -13.83%)
  pwd           1.10 MB ->     968 KB  (-156 KB, -13.88%)
  tty           1.09 MB ->     964 KB  (-156 KB, -13.93%)
  unlink        1.10 MB ->     968 KB  (-156 KB, -13.88%)
  users         1.11 MB ->     976 KB  (-156 KB, -13.78%)
  whoami        1.09 MB ->     964 KB  (-156 KB, -13.93%)
  arch          1.09 MB ->     968 KB  (-152 KB, -13.57%)
  dirname       1.09 MB ->     968 KB  (-152 KB, -13.57%)
  hostid        1.09 MB ->     964 KB  (-152 KB, -13.62%)
  logname       1.09 MB ->     964 KB  (-152 KB, -13.62%)
  yes           1.10 MB ->     976 KB  (-152 KB, -13.48%)
  echo           984 KB ->     868 KB  (-116 KB, -11.79%)
  false          948 KB ->     840 KB  (-108 KB, -11.39%)
  true           948 KB ->     840 KB  (-108 KB, -11.39%)

@xtqqczze
Copy link
Copy Markdown
Contributor Author

@oech3 some of these regressions seem pretty bad:

true_consecutive_calls
-99%
199.4 ns
21,985.3 ns

I wonder if we should remove release-small profile?

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Apr 30, 2026

This is same with Ubuntu's default.
Also this is very useful for test only usage for less build time. We should NOT remove this profile.

@xtqqczze xtqqczze deleted the opt-level branch April 30, 2026 01:14
@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Apr 30, 2026

Since we benches uu_main only, we cannot bench overhead of caching binary to RAM. So uu_true bench is not reliable at here.

It might be able to use Command.

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