Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I tried adding LC_ALL=C as well as LC_ALL=en_US.UTF-8 and it didn't make much of a difference outside of BSD cut[0].

The input file to the benchmark is all ASCII text chars (unibyte?) and `choose` does take the safe(r?) route and assume all text is UTF-8 and handle accordingly.

0:

          | LC_ALL=C   | LC_ALL=en_US.UTF-8   | not setting LC_ALL explicitly
            -------------------------------------------------------------------
  choose  | 110.6  ms  | 110.6  ms            | 110.8  ms
  cut     | 813.9  ms  | 983.9  ms            | 971.7  ms
  gcut    | 172.8  ms  | 172.5  ms            | 174.0  ms
  ucut    | 78.22  ms  | 79.39  ms            | 79.38  ms


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: