From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61514: 30.0.50; sadistically long xml line hangs emacs Date: Tue, 21 Feb 2023 08:24:14 -0500 Message-ID: References: <87lel0c65v.fsf@everybody.org> <838rgvymcd.fsf@gnu.org> <831qmkwmux.fsf@gnu.org> <83cz64v3v7.fsf@gnu.org> <83r0ujte97.fsf@gnu.org> <6abb5de688808f8d363d@heytings.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14095"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 61514@debbugs.gnu.org, mah@everybody.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 21 14:25:19 2023 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 1pUSdy-0003Sm-M5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Feb 2023 14:25:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUSdl-0000A1-B1; Tue, 21 Feb 2023 08:25:05 -0500 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 1pUSdi-00009H-JB for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 08:25:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUSdi-0006QK-8X for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 08:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUSdh-0004DN-UM for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 08:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2023 13:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61514 X-GNU-PR-Package: emacs Original-Received: via spool by 61514-submit@debbugs.gnu.org id=B61514.167698586616125 (code B ref 61514); Tue, 21 Feb 2023 13:25:01 +0000 Original-Received: (at 61514) by debbugs.gnu.org; 21 Feb 2023 13:24:26 +0000 Original-Received: from localhost ([127.0.0.1]:54968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUSd8-0004C1-3O for submit@debbugs.gnu.org; Tue, 21 Feb 2023 08:24:26 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUSd5-0004Bo-PP for 61514@debbugs.gnu.org; Tue, 21 Feb 2023 08:24:24 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E31D8807CB; Tue, 21 Feb 2023 08:24:17 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7715B80058; Tue, 21 Feb 2023 08:24:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1676985856; bh=q+ZfJ59Xlx036mbhOvwokMUmdOMxSJf4Sn3wOXDOhcQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=KB5vc8azS+4qH45tU/AY7oaMD4zw/fWwvE0+p5xR6RlrwBqgFR8c390TM1+k1ZYka G3PFpgkVGN1cQIAtrLFEZy83eysW3z9vgaPNWW2ZgLYOej3mT/KDtZ30Gz0whyTXnZ kx3riyWCRcT46OY9lgmvFoUDZ4zfdzv2ojUKBzq5OBTx4ihelBuoYWyTv6Pd/UzIN6 d4tTe9YTsgVcfI0Ce/6rey9b6LC5Eewr6rsRdrtLU+T8+FjWXzTOOjGYQqooMpTByf xOmgeRoVGpAvncILLMlrMPB4UKYa+pTHKa0c+ZFeKe6Y//8HVYRhDuDFvlhdMpi+px l6nVxPaYpOsow== Original-Received: from pastel (unknown [216.154.34.24]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4A141123212; Tue, 21 Feb 2023 08:24:16 -0500 (EST) In-Reply-To: <6abb5de688808f8d363d@heytings.org> (Gregory Heytings's message of "Tue, 21 Feb 2023 12:37:11 +0000") 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:256266 Archived-At: >> SGTM, but isn't 1000 a somewhat low value? What if we use half of the >> value of long-line-optimizations-region-size instead? >> > > Here are some benchmarks. The time taken by Emacs to open the 4 MB > "n_n_..." file with different regexps are: > > "[^<>\n]\\{1,100\\}?\\<": 0.8 seconds > "[^<>\n]\\{1,1000\\}?\\<": 3.4 seconds > "[^<>\n]\\{1,10000\\}?\\<": 28.5 seconds > "[^<>\n]\\{1,65535\\}?\\<": 162.9 seconds > "[^<>\n]+?\\<": 356.6 seconds > > 65535 is the upper limit for such ranges, it's not possible to use > a larger value. BTW, personally when I suggested to limit the search I was thinking of `narrow-to-region` (which bounds both N factors in the N=B2 complexity). AFAIK this part of the code is intended mostly when editing XML by hand, where attributes aren't expected to be ridiculously long, so limiting to a few kB would be perfectly acceptable (and if the search fails it's not big deal: when the search succeeds we don't *really* know what it means either, it may be a false positive anyway). Stefan