GNU bug report logs - #40540
Faster sort with locale

Previous Next

Package: coreutils;

Reported by: Ole Tange <ole <at> tange.dk>

Date: Fri, 10 Apr 2020 13:20:01 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ole Tange <ole <at> tange.dk>
To: bug-coreutils <at> gnu.org
Subject: Faster sort with locale
Date: Fri, 10 Apr 2020 15:19:19 +0200
I have noticed that if locale is set, then sort becomes much slower.

I imagine that it is because instead of doing

  simple_compare(string1,string2)

it does:

  localized_compare(string1,string2)

But would it be possible to convert the input string1 into a string in
a generalized format, which would sort the same way as the localized
sort, but using a simple compare? Like this:

  string1_general = localize(string1)
  string2_general = localize(string2)
  simple_compare(string1_general,string2_general)

If that is possible, then localize() can be done by other cores in
advance and thereby offload the "primary" core.


/Ole




This bug report was last modified 5 years and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.