GNU bug report logs - #58168
string-lessp glitches and inconsistencies

Previous Next

Package: emacs;

Reported by: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>

Date: Thu, 29 Sep 2022 16:25:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58168 <at> debbugs.gnu.org
Subject: bug#58168: string-lessp glitches and inconsistencies
Date: Fri, 14 Oct 2022 16:39:55 +0200
As performance is more acceptable now I'm not going to take any further action with respect of string<, but let me just answer your questions:

8 okt. 2022 kl. 09.35 skrev Eli Zaretskii <eliz <at> gnu.org>:

> I suggested to use memchr to find whether a string has any
> C0 or C1 bytes, _before_ doing the actual comparison, to find out
> whether a multibyte string includes any raw bytes, which would then
> require slower comparisons.

That isn't practical; we would traverse each argument in full, twice, even if there is a difference early on. While memchr is fast for what it does, it will still need to look at every bit of its input.

> I also suggested to try memmem as yet another possibility

There is no reason to believe that this would help in any way.

> This is me being happy.

Thank you, let's both rejoice then! Again, the improvements and analyses have been worthwhile.





This bug report was last modified 2 years and 276 days ago.

Previous Next


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