[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: locale.png (13 KB, 1302x337)
13 KB
13 KB PNG
compare these outputs. (ltrace required)
LANG=C.UTF8 watch -n2 'ltrace -c echo "something"'

LANG=en_US.UTF8 watch -n2 'ltrace -c echo "something"'


how can the C locale be almost twice as fast as en_US? both are UTF8. is it that much lighter?

why should I not use the C locale instead of en_US to gain some performance?
the setlocale function is so common.

also, C locale without UTF8 is even faster. in fact when you use UTF8 locale, in a program like echo, the setlocale function is constantly the slowest one.

as soon as you use non-utf8 C locale, the setlocale function is no longer bottlenecking the whole program.
>>
It's en-US, retard.
>>
File: locale3.png (14 KB, 689x635)
14 KB
14 KB PNG
picrel is C vs C.UTF8 on another system.

even comparing en_US.UTF8 vs en_US shows en_US loads twice as fast.


>>107039569

no you are
>>
here is en_US on top and en_US.UTF8 on bottom.

actually more than double the amount of time to load UTF8
>>
File: locale4.png (14 KB, 633x650)
14 KB
14 KB PNG
>>107039617
>>
i obviously can't get rid of UTF8 so i think i will be using C.UTF8 everywhere from now on.

i was wondering why my chroot system felt so damn fast. now i know. its the heckin locale.
>>
>>107039601
You're the retard for asking dumb questions. Look at the actual code to see what it's doing, moron.
I just checked and it's very plain that with C/POSIX it doesn't run like half the branches in there.
As for UTF8 being slower, that's a given since it has to set up all the crap that makes it know how to interpret stuff since it's not as trivial as base ASCII.
Now delete this thread.
>>
>>107039642
>Now delete this thread.
no, fuck you
>>
seems like the C locale is best for grep and probably other text processor performance

https://www.inmotionhosting.com/support/server/linux/speed-up-grep-searches-with-lc-all/
>>
>>107039837
ok. meanwhile i just want cat or grep to be faster because i actually use my computer for other things than number crunching,

setlocale is bottlenecking hard on my system on anything but the C locale
it must have been a scam to have made complex locales the default for everything
>>
if i understand it correctly, musl didn't implement locales at all.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.