Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • A note: LC_ALL=C /bin/bash cuts the time from 1.537s to 0.695s on my rig, vs. 0.497s for /bin/dash. Commented Mar 17, 2024 at 21:08
  • @jthill, that big a difference with just that loop I used above? Curious, it doesn't really even do anything the locale would affect... And I expected that would mostly show the time used for startup. I suppose there's some overhead in loading the locales, and I can see some difference, but not nearly as large. I tried unsettting LANG and all the LC_* envvars, and then ran (export LC_ALL="en_US.UTF-8"; locale; time for x in {1..1000} ; do /bin/bash -c 'true' ; done ) and got 1.60 s for LC_ALL=en_US.UTF-8 vs. 1.48 for LC_ALL=C. Commented Mar 18, 2024 at 7:09
  • I was leaving off setting it for the non-C, getting my usual environment, LANG=en_US.UTF8 LC_COLLATE=C LC_NUMERIC=C. Doing the unmixed en_US saves about 0.2s on the loop but yeah your exact loop, it's repeatable for me on Arch, LC_ALL=C cuts the startup times dramatically. Bash 5.2.26, maybe they're working on it? Haven't checked the changelogs. Commented Mar 18, 2024 at 8:14