Skip to content

Conversation

@ChrisDryden
Copy link
Contributor

@ChrisDryden ChrisDryden commented Dec 9, 2025

I wanted to learn a bit about the performance characteristics of coreutils for the commands that were listed as being slower than the GNU implementations. One of the reasons listed for being slower is that the translation files are parsed even when they are not needed: #9103

I was able to find some examples online of how you can add a wrapper to the clap parser that can modify the clap command if it recognizes that the help command is being called and then the translation keys can be obtained. When doing the original comparisons using hyperfine commands shown in that issue, my timing was similar to what was described in the issue but afterwards it moved from 2. ms to 1.0 ms.

Metric GNU ln uutils glibc
Speed 805 µs 1.0 ms

This tells me that after adding the fix for the translations to not be parsed, we have a clear path to replacing some of the glibc calls with more native functionality using nix and we should be able to perform faster than the GNU implementation.

@ChrisDryden ChrisDryden changed the title Adding example of how the clap parser can be setup Example of translation after parsing clap for performance Dec 9, 2025
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

GNU testsuite comparison:

GNU test failed: tests/install/basic-1. tests/install/basic-1 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/install/install-C. tests/install/install-C is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/install/install-C-root. tests/install/install-C-root is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/install/install-C-selinux. tests/install/install-C-selinux is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 9, 2025

CodSpeed Performance Report

Merging #9615 will improve performances by 2.04%

Comparing ChrisDryden:translate_after_parse_idea (e2baf1c) with main (85aabf2)

Summary

⚡ 1 improvement
✅ 126 untouched
⏩ 6 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Change
tsort_input_parsing_heavy[5000] 84.6 ms 82.9 ms +2.04%

Footnotes

  1. 6 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.

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.

1 participant