The locale-gen script installed by sys-libs/glibc-2.5-r4 explicitly disables creating /usr/lib/locale/locale-archive. The effect of this is that every glibc-using program, upon startup, will read a large number of locale files, some of which may not even exist. This is silly, especially for lightweight programs like 'cat' that get invoked hundreds of times by scripts. If locale-archive is present though, only that file gets read. You can see the results for yourself with 'strace cat /dev/null'. On my system: Without locale-archive: 104 syscalls, 31 of them 'open' With locale-archive: 33 syscalls, 4 of them 'open' All of those 'open' calls have a price. In the discussion at the provided URL, Arjan van de Ven (powertop/kernel developer) notes about opening nonexistant files: "the lifespan of negative dentries is so short that you still go to disk ;(" So this is both a power-saving and performance issue. Reproducible: Always Steps to Reproduce: 1. run locale-gen 2. strace cat /dev/null 3. Actual Results: /usr/lib/locale/locale-archive does not exist, so cat then wastes many syscalls getting locale information. Expected Results: /usr/lib/locale/locale-archive should be created, and cat and any other program should use it.
the locale-gen script from debian (which was used as a source from this one) it now being maintained as part of the belocs-locales-bin package and uses a configuration file to define this behaviour
No, this behaviour cannot be changed via the configuration file, unless the manpage is wrong
the Debian stuff inspired the Gentoo version, but the locale-gen script we use isnt even close as i wrote it from scratch to be Gentoo integrated rather than just Debian dropped in locale archives didnt really integrate well (at all) into existing system, but i guess i can just make the script warn when that happens
for example, localedef cannot be run in parallel ... and actually, nothing is stopping you from right now using an archive: locale-gen --
ive changed locale-gen to default to generating a locale-archive, but the behavior is still controllable by the user http://sources.gentoo.org/gentoo/src/patchsets/glibc/extra/locale/locale-gen?r1=1.23&r2=1.24