From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer Date: Mon, 24 Aug 2020 20:27:30 +0300 Message-ID: <83r1rw54zh.fsf@gnu.org> References: <83blj072j0.fsf@gnu.org> <875z98c6et.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40599"; mail-complaints-to="usenet@ciao.gmane.io" Cc: laszlomail@protonmail.com, 43016@debbugs.gnu.org, eggert@cs.ucla.edu To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 24 19:28:09 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 1kAGGP-000AS8-35 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 19:28:09 +0200 Original-Received: from localhost ([::1]:32822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAGGO-0007O4-3J for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 13:28:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAGGI-0007MI-2D for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 13:28:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47565) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAGGH-0007As-Oh for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 13:28:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kAGGH-0004Pg-Jv for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 13:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Aug 2020 17:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43016 X-GNU-PR-Package: emacs Original-Received: via spool by 43016-submit@debbugs.gnu.org id=B43016.159829007616953 (code B ref 43016); Mon, 24 Aug 2020 17:28:01 +0000 Original-Received: (at 43016) by debbugs.gnu.org; 24 Aug 2020 17:27:56 +0000 Original-Received: from localhost ([127.0.0.1]:59111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAGGB-0004PM-NZ for submit@debbugs.gnu.org; Mon, 24 Aug 2020 13:27:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAGG9-0004P1-NC for 43016@debbugs.gnu.org; Mon, 24 Aug 2020 13:27:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49875) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAGG3-00079H-LY; Mon, 24 Aug 2020 13:27:47 -0400 Original-Received: from [176.228.60.248] (port=3999 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kAGG1-0000CI-EH; Mon, 24 Aug 2020 13:27:46 -0400 In-Reply-To: <875z98c6et.fsf@gnu.org> (message from Tassilo Horn on Mon, 24 Aug 2020 19:14:50 +0200) 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:186194 Archived-At: > From: Tassilo Horn > Cc: Eli Zaretskii , > "43016@debbugs.gnu.org" <43016@debbugs.gnu.org>, > Paul Eggert > Date: Mon, 24 Aug 2020 19:14:50 +0200 > > So basically I'd say the problem is in gnulib's compareseq. If it can't > be fixed there, I see no other possibility than to stop using > replace-buffer/region-contents in json.el (and wherever it might also be > used). That would be sad because except for the performance in some > cases, it's very nice. :-( Could we decide whether to use replace-* functions dynamically, based on the size of the region/buffer being prettified? Btw, there's another problem with compareseq, see bug#42931. I guess we need to add another criterion for early_abort, based on depth of recursion? Thanks.