From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#58168: string-lessp glitches and inconsistencies Date: Fri, 7 Oct 2022 16:23:26 +0200 Message-ID: References: <7824372D-8002-4639-8AEE-E80A6D5FEFC6@gmail.com> <83czbef6le.fsf@gnu.org> <6CB805F6-89EE-4D7C-A398-F29698733A42@gmail.com> <83h70oce4k.fsf@gnu.org> <83tu4mais1.fsf@gnu.org> <83wn9gw2sp.fsf@gnu.org> <83wn9dp5xp.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24689"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58168@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 07 17:14:23 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogp3N-0006Dh-K9 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Oct 2022 17:14:21 +0200 Original-Received: from localhost ([::1]:43296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogp3M-0002xm-M9 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Oct 2022 11:14:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogoGg-0002tq-Jp for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 10:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogoGg-0004wW-9m for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 10:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogoGf-0004Bk-SD for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 10:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Oct 2022 14:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58168 X-GNU-PR-Package: emacs Original-Received: via spool by 58168-submit@debbugs.gnu.org id=B58168.166515261516036 (code B ref 58168); Fri, 07 Oct 2022 14:24:01 +0000 Original-Received: (at 58168) by debbugs.gnu.org; 7 Oct 2022 14:23:35 +0000 Original-Received: from localhost ([127.0.0.1]:37027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogoGF-0004AY-0D for submit@debbugs.gnu.org; Fri, 07 Oct 2022 10:23:35 -0400 Original-Received: from mail-lj1-f180.google.com ([209.85.208.180]:43541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogoGD-0004AJ-Fe for 58168@debbugs.gnu.org; Fri, 07 Oct 2022 10:23:34 -0400 Original-Received: by mail-lj1-f180.google.com with SMTP id r22so4577743ljn.10 for <58168@debbugs.gnu.org>; Fri, 07 Oct 2022 07:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=/R8x79nssjRuJ/NW6CIT4KCZ7CEaqunNsyOqyNoL8oU=; b=XaZNIIwg7g0e3tSZ/S0ZHH6AciI8EZAl6mvUKImHZP0IfV/K1J+QZ4mvEehI7GuH+0 1hvSJx09q6NcQLotcp4lFgBmJeGXIEBzp7iGTFagbDKJZmnKXvtWsr4nmRwUsPcnEy// 0MhLsHTfa05qx7guOLfC8+5c5FUqNHJp/pyLSnEUDg9ktE7Udp+f5X9i0dX4/5p1aClt oLSniRBcKJVaklOauMVDRwGYPja5L86ZnhTPEAMrUyV1Ufc8Wk1KHqADPka26L+CYpJC BOydB6z5WMH7ki0mRFAkPGGO/Q2ehSDLMj8AJTvq5ifIMV+30q/9hF4FPntWjbmtduio IOFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/R8x79nssjRuJ/NW6CIT4KCZ7CEaqunNsyOqyNoL8oU=; b=JzYVACBUMhS3dcQLbFqQjbbYhZmA+UoLSVoBycmBcC/T0rb3h4pctf8oBNit58uEtB 2eIhSqm6D65KG1Jbqkp2pvnmMNLoWfvMXcvNSVLrIB1YEIau0r5Bts4CBMbssmgPolWH pqw1TAV4idkprpveYxVRNaFK4PrQxKLG4OHrIIhGwa50TlM5XbQXUF+qwrC0ws9XhYGC FepGWqbqfI4Ap2rdaeflSN/qdEwi6En3zxBvPd2i1tzx3IWS46C7/plaCmwwNYA7mdFf 3XMkBUPpRUBfjGt/3f6Blf/TWN8NHCZL7bpzQAIKi87/aiW14FT/X5oJE7oDKzt9bJ8w D1KQ== X-Gm-Message-State: ACrzQf0YMkvkRYOM/fCIbl0foRirl0dXW8tR05SprcxXwETUNkvmdlYZ 3DxG6lWaLsb93zzjwH+42bE/Bbk3jVo3xA== X-Google-Smtp-Source: AMsMyM5TTXe9+mvdeF62UuPY7Rp6tq/aKUHVcjWxifDYVrZ0e1JqewLHbIgWR9I4Sp4rrWXRwi+g7Q== X-Received: by 2002:a2e:a607:0:b0:26c:42c8:13af with SMTP id v7-20020a2ea607000000b0026c42c813afmr1704604ljp.267.1665152607195; Fri, 07 Oct 2022 07:23:27 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se. [188.150.171.209]) by smtp.gmail.com with ESMTPSA id q11-20020ac2514b000000b0049f54c5f2a4sm308648lfd.229.2022.10.07.07.23.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 07:23:26 -0700 (PDT) In-Reply-To: <83wn9dp5xp.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244815 Archived-At: 6 okt. 2022 kl. 13.06 skrev Eli Zaretskii : > Cf. NaN comparisons with numerical values. Emacs strings are completely different from floats and NaNs in just = about every respect; no meaningful parallels can be drawn. (And do = believe me when I say that we should be thankful for that.) > You missed me here. Why are you suddenly talking about mismatches? > And if only mismatches matter here, why is it a problem to use memchr > in the first place? Any lexicographic comparison is a matter of finding the first point of = difference, then interpreting the difference at that point. `memchr` = does not help with that, nor does `memcmp` unless we are doing a = bytewise string comparison. I've pushed a further optimisation of the comparison between arbitrary = multibyte strings; it's now sufficiently fast that I no longer worry = much about it (on my machine asymptotically 10=C3=97 faster than before, = yet 30 % slower than memcmp). Similar improvements could be made to the comparison between unibyte and = non-ASCII multibyte strings. These are less common and not quite as = slow; I haven't made up my mind about whether it's worth the trouble. Again it's complicated by the equivalence between unibyte and Latin-1: = it means that two equal strings can have different byte patterns, which = in turn makes it much more expensive to find the longest common prefix. = (Thus this point is of practical interest in several respects.) In any case, the situation is now better than it was before the bug was = opened: string< is faster and the remaining problems have at least been = chartered, whether or not an agreement to remedy them can be reached. = Let's be happy about this!