From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#40407: [PATCH] slow ENCODE_FILE and DECODE_FILE Date: Sun, 5 Apr 2020 12:48:51 +0200 Message-ID: <51EFA20B-3F32-4242-82D5-EA2D2FB2FD3E@acm.org> References: <805F9723-8298-4FD7-A47B-1E683721A5B0@acm.org> <835zegwn9y.fsf@gnu.org> <83imifv96b.fsf@gnu.org> <42EFD1AE-A96E-4613-A31E-C3723382DC6D@acm.org> <83r1x3tc6c.fsf@gnu.org> <1C9D87C7-57DD-4C61-86FE-99A7095E5085@acm.org> <83imift8fj.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="2759"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40407@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 05 12:50:25 2020 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 1jL2rB-0000cU-G0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Apr 2020 12:50:25 +0200 Original-Received: from localhost ([::1]:46762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jL2rA-0001rn-65 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Apr 2020 06:50:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40437) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jL2qp-0001r3-FG for bug-gnu-emacs@gnu.org; Sun, 05 Apr 2020 06:50:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jL2qo-0002mC-Fo for bug-gnu-emacs@gnu.org; Sun, 05 Apr 2020 06:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jL2qo-0002m2-Cb for bug-gnu-emacs@gnu.org; Sun, 05 Apr 2020 06:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jL2qo-0001vf-7y for bug-gnu-emacs@gnu.org; Sun, 05 Apr 2020 06:50:02 -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: Sun, 05 Apr 2020 10:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40407-submit@debbugs.gnu.org id=B40407.15860837437208 (code B ref 40407); Sun, 05 Apr 2020 10:50:02 +0000 Original-Received: (at 40407) by debbugs.gnu.org; 5 Apr 2020 10:49:03 +0000 Original-Received: from localhost ([127.0.0.1]:45253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jL2pr-0001sA-Em for submit@debbugs.gnu.org; Sun, 05 Apr 2020 06:49:03 -0400 Original-Received: from mail212c50.megamailservers.eu ([91.136.10.222]:48612 helo=mail194c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jL2pp-0001rJ-4H for 40407@debbugs.gnu.org; Sun, 05 Apr 2020 06:49:02 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1586083734; bh=Qsh3rxSsePlA/U21FLZT78lAk8DtoI8V+bqzWoGBMPE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=lRvSf/NMOGNA880ZOTj0wiwnFn+7FQ1UMt2bR7WpJMDcGskTy1nVjRJpobpQAm7yK 1uu7ukk/1KoMP6u0DyUBdQT85OiNsqI0K5sW1VnjS6nkbsZ3nL4dDdNyQHnI8SCcEE U9LtWhjGp1gGCQPuNsB6Y34VPW7c4Zs1xKozCN2s= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail194c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 035Ampk8019188; Sun, 5 Apr 2020 10:48:53 +0000 In-Reply-To: <83imift8fj.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F17.5E89B76C.0013, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KsozJleN c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=wv5BUt5QEtqpqBFRnnYA:9 a=FMZy9d7vl412MyZU:21 a=BBryQZiZ5wwlhcHs:21 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:178053 Archived-At: 4 apr. 2020 kl. 20.25 skrev Eli Zaretskii : > That's true. But as a matter of fact, I don't see any calls to > code_convert_string with NOCOPY non-zero, they all pass zero or false > to it. So none of the existing direct calls from C wants or expects > to get the same string. Right. However, I did some reading and believe that nocopy=3Dtrue is = actually correct for all uses of {EN,DE}CODE_FILE, and in fact all calls = to code_convert_string_norecord. One of the reasons is that the callers = need to be careful with mutation wrt GC anyway; any post-recoding = mutation is done on copies. (Not being able to change the length of = strings also helps.) I pushed what we agreed on in part for the pleasure of resolving such an = old-standing bug) to master (962562cde4). Given the limited scope of the change, would you agree to a backport of = that to emacs-27? For the reasons above, I think it's correct and proper to do (on master) --- a/src/coding.c +++ b/src/coding.c @@ -9554,7 +9554,7 @@ code_convert_string (Lisp_Object string, = Lisp_Object coding_system, code_convert_string_norecord (Lisp_Object string, Lisp_Object = coding_system, bool encodep) { - return code_convert_string (string, coding_system, Qt, encodep, 0, = 1); + return code_convert_string (string, coding_system, Qt, encodep, 1, = 1); }