From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70784: Abolish string resizing Date: Mon, 06 May 2024 12:41:59 +0800 Message-ID: <87fruv5z6w.fsf@yahoo.com> References: Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2256"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 70784@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 06 06:43:31 2024 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 1s3qCJ-0000R3-0P for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 May 2024 06:43:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3qBy-0001y7-Fo; Mon, 06 May 2024 00:43:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3qBT-0001mv-1Z for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 00:42:39 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3qBS-0002Bm-MQ for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 00:42:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s3qBq-0003k5-6f for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 00:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 May 2024 04:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70784 X-GNU-PR-Package: emacs Original-Received: via spool by 70784-submit@debbugs.gnu.org id=B70784.171497057614376 (code B ref 70784); Mon, 06 May 2024 04:43:02 +0000 Original-Received: (at 70784) by debbugs.gnu.org; 6 May 2024 04:42:56 +0000 Original-Received: from localhost ([127.0.0.1]:35549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3qBk-0003jo-7L for submit@debbugs.gnu.org; Mon, 06 May 2024 00:42:56 -0400 Original-Received: from sonic313-9.consmr.mail.ne1.yahoo.com ([66.163.185.32]:41715) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3qBe-0003jc-TU for 70784@debbugs.gnu.org; Mon, 06 May 2024 00:42:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1714970539; bh=NE2lREGOr8TryVlm7a/wsgdta1oHzh8QrzKs+GSVKPA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=RYRLwaFQHSdYifaE92bvpCdN7mRBzm2d9TKzjUz5M260q+E9KuGdHJU9SmtY2lenczZzb2a81lpRDiUIYoFOKx6m892xtKcsNArEj/mq4VSIR797CvVGAO9enASwedu3kdjeAEpv9nPgyXmf5OqaEtRu0HOeSWLzldqC1fS9ABUqDhLIj67/YkJO3QHzxoO4WPrV+ry+zy9NHfO7akLToj02cAoTBRSl+xRNlCVqpBSDeJq1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eU3hSdORja0Sr5gWZrHOvovRyHUOCHFHPsS_FWREfH3ynP30P1m9j5C8j7TrugyFUOPc6lWqkxq1 EFpzNIdyDIKY0M9lZ33Ztbm9cqM7ubq7PRWZlWmP50cj2zEzKJqC610Wyw88YjFl.Z37LCqQ4ejj s.1ro.dV8i2xu.4AYfiaMH6mdbjEwOPwdhcWT5VwFjo2OUPPH8RU_l8hvEU_N000h7LbQCTvGM9j luH5h5bLyTTkCOj2TPBV.rVI8MDebgQ6hAmGc09.l2Ce_3cGlfS09.T0DvNIeQn4BoZ_OwX9jecp sFHCONjJ1K8GOgqHGAjbcYe1W5dNznzrFXEs1lG07_UbXQH07rY.7uEXtBpBAa4HxH6pzrCcGMYv Xy_.EG9gJS3wnVBOXpwQAlCklbtu79OrteP__ZzdUQ X-Sonic-MF: X-Sonic-ID: 09d86741-262e-4fdf-8b60-d4b80d6ca0c5 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Mon, 6 May 2024 04:42:19 +0000 Original-Received: by hermes--production-sg3-6f9f87bd85-86wsl (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 3e5d024cca5a816e396338a93c357270; Mon, 06 May 2024 04:42:16 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Sun, 05 May 2024 22:41:54 -0400") X-Mailer: WebService/1.1.22256 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284555 Archived-At: Stefan Monnier writes: > Actually, it's not "immemorial", it's just old: > > commit 3c9de1afcde82a99137721436c822059cce79b5b > Author: Kenichi Handa > Date: Fri Jul 21 06:45:30 2000 +0000 That's _23_, approaching 24 years, in the past, or 1 generation exactly. To put this into perspective, a mere 2 years and 7 months after the introduction of multibyte strings. > > (Faset): Allow storing any multibyte character in a string. Convert > unibyte string to multibyte if necessary. > > IOW, since Emacs-21.1. Only two releases after the distinction between multibyte and unibyte strings was introduced. Evidently, this departure from traditional array behavior was seen as a misdesign at the time, and we should know better than to second-guess old design decisions, especially those from a past when computer memory and performance were far scarcer commodities than today. > As for improvements, like a lot of refactoring and maintenance work, > there isn't any immediate benefit. But it's a "feature" which is *very* > rarely used (thank god: it makes a notionally constant time operation > take time proportional to the size of the string, so if it were used > often we would have heard complaints about the poor performance) and > which imposes pretty significant implementation constraints, so it's > definitely detrimental to long term evolution. Placing quotation marks around the word "feature" does not make it any less of a feature, and if reports of performance woes be the judge of whether a feature is sufficiently disused to justify removal, then, why, virtually all (vastly underreported) sub-optimal code in Emacs would be eligible for immediate deletion attended by irritating pop-up warnings.