GNU bug report logs - #33887
26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Vincent Lefevre <vincent@HIDDEN>; dated Thu, 27 Dec 2018 10:14:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Jan 2019 22:15:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 08 17:15:37 2019
Received: from localhost ([127.0.0.1]:50612 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ggzeq-0004XO-SB
	for submit <at> debbugs.gnu.org; Tue, 08 Jan 2019 17:15:37 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36784)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <fernando.ej@HIDDEN>) id 1ggzae-0004PM-61
 for submit <at> debbugs.gnu.org; Tue, 08 Jan 2019 17:11:16 -0500
Received: from lists.gnu.org ([209.51.188.17]:56974)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <fernando.ej@HIDDEN>)
 id 1ggzaY-00043t-Vr
 for submit <at> debbugs.gnu.org; Tue, 08 Jan 2019 17:11:11 -0500
Received: from eggs.gnu.org ([209.51.188.92]:46980)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <fernando.ej@HIDDEN>) id 1ggzaY-0006r9-5w
 for bug-gnu-emacs@HIDDEN; Tue, 08 Jan 2019 17:11:10 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <fernando.ej@HIDDEN>) id 1ggzaX-00042v-Ex
 for bug-gnu-emacs@HIDDEN; Tue, 08 Jan 2019 17:11:10 -0500
Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:43244)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <fernando.ej@HIDDEN>)
 id 1ggzaX-000409-B8
 for bug-gnu-emacs@HIDDEN; Tue, 08 Jan 2019 17:11:09 -0500
Received: by mail-qt1-x842.google.com with SMTP id i7so6209407qtj.10
 for <bug-gnu-emacs@HIDDEN>; Tue, 08 Jan 2019 14:11:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:date:message-id:user-agent:mime-version;
 bh=/HDcdd8CfBa0p1CHQgBR72dP2zxUA/imeA8yeDRFLmo=;
 b=N4oW44fWiSWqnXS8fjXw64fuz7ic6QnMN5ZJNYArBZ6fmkRWm6yOcsBsUE/GJbEXYs
 znV7E0+Pf2F5iqyaG/nFrR5aX7VLgZ2Np6jlsBTqUvnwGt6oJQsUrLEzxVQRyTedQXsj
 moJ69sHBrQQrJJeM6hNJvpJAqREBpXKvZQrontDMGQ4ORGH2f2i4fGgcN9tDtj2Objk8
 fTuV73rPp4vshxkxKNxtwfk5d7Z6Gnj1yATZMMVv4jJ9tIV4YUZ83nNJeckiTkm1O5Hb
 lhCgHHswcaMXQShO7julkQyX0Wp12iIlKAEwd9WdNhcmzxlnArP4h0+B31Z73yieWNSQ
 nTvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:user-agent
 :mime-version;
 bh=/HDcdd8CfBa0p1CHQgBR72dP2zxUA/imeA8yeDRFLmo=;
 b=hXSa4geMz+ccWf6EYZ8Vov735o3NjV2ROlw+fFGAfTbjewTI4OM4dyBg7B9fQ28o3A
 YoxCF4xxJBGy5eoF9T4noXC//r+md7sOXmoLwpIQVnLHYtaBiGzeHVIHyRa81gYfaU7G
 inzJnBQhYwiLCLgxd0zMnciqkV2xuqThy+PXegCsM7qVYR3s/BloxJnCPihPDQoHDW9t
 WRMNnrCy6htruj0lfgN3XUQWccHCWYYeQXxWuvbt3QKpB2EHwEDN7eQB/+kG5lfs9LdT
 5OV3f6iAHzcu8a79rDFyCllQ6fORJy7KHOuP5KCwiPsPt608OjaZJp6fqYk87+9Cz5sA
 oV4w==
X-Gm-Message-State: AJcUukdoQRWNcKJ+jpYgD+0dV49h11gkl2/sF8vOZxSFGWiuxiVoVHqw
 9h/HO25RTU8cLujLY836CnJklEW2jjc=
X-Google-Smtp-Source: ALg8bN4wyRcXxQYE12Q0eIxPUmikKe8UbtPV5dOXNtkIhU5PiHBN8DkNJvEbNfsc/S40DRZbL1rZog==
X-Received: by 2002:ac8:7353:: with SMTP id q19mr3316686qtp.265.1546985467742; 
 Tue, 08 Jan 2019 14:11:07 -0800 (PST)
Received: from pop-os ([168.232.248.7])
 by smtp.gmail.com with ESMTPSA id a17sm33321049qth.93.2019.01.08.14.11.05
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Tue, 08 Jan 2019 14:11:07 -0800 (PST)
From: Fernando Jascovich <fernando.ej@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: bug#33887: 26.1;
 Emacs hangs for several seconds when going to the end of an XML file
 in nXML mode
Date: Tue, 08 Jan 2019 19:11:02 -0300
Message-ID: <87ef9m2421.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::842
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 08 Jan 2019 17:15:35 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi everyone, this is my first email to bug-gnu-emacs, so please let me
know if I am making some mistake.
For no special reason, I took this bug in order to start to know  emacs'
code.
Following and confirming the details of the bug, I found that indeed the
performance issue is introduced at commit 0055190174, but not beacuse
the introduction of `sgml-syntax-propertize-inside`.
The problem is with the last rule:
```
("\"" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0))))
                    (goto-char (match-end 0)))
                  (string-to-syntax ".")))
```
I can't see the real effect of this rule, I tested xml parsing without
this rule and it works fine, marking double quotes inside tags as
expected without this performance issue.
Do we need to target double quotes outside tags explicitly?

-- 
Fernando Jascovich
developer
m: +54 9 3548 63 9833
github: https://github.com/fernando-jascovich/
linkedin: https://www.linkedin.com/in/fernandojascovich/




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33887; Package emacs. Full text available.

Message received at 33887 <at> debbugs.gnu.org:


Received: (at 33887) by debbugs.gnu.org; 28 Dec 2018 17:18:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 28 12:18:56 2018
Received: from localhost ([127.0.0.1]:40634 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcvmi-0005RZ-1k
	for submit <at> debbugs.gnu.org; Fri, 28 Dec 2018 12:18:56 -0500
Received: from chene.dit.umontreal.ca ([132.204.246.20]:56250)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1gcvmf-0005RQ-H4
 for 33887 <at> debbugs.gnu.org; Fri, 28 Dec 2018 12:18:54 -0500
Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca
 [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wBSHIpDW015853;
 Fri, 28 Dec 2018 12:18:52 -0500
Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848)
 id 36287AE0D0; Fri, 28 Dec 2018 12:18:51 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Vincent Lefevre <vincent@HIDDEN>
Subject: Re: bug#33887: 26.1;
 Emacs hangs for several seconds when going to the end of an XML file
 in nXML mode
Message-ID: <jwv7efty3lv.fsf-monnier+emacsbugs@HIDDEN>
References: <87ftujuvkd.fsf@HIDDEN> <83imzf6jr4.fsf@HIDDEN>
 <jwvo997x773.fsf-monnier+emacsbugs@HIDDEN> <83ftui7wf1.fsf@HIDDEN>
 <jwv8t0a27yy.fsf-monnier+emacsbugs@HIDDEN>
 <20181227184302.GG2581@HIDDEN>
Date: Fri, 28 Dec 2018 12:18:51 -0500
In-Reply-To: <20181227184302.GG2581@HIDDEN> (Vincent Lefevre's
 message of "Thu, 27 Dec 2018 19:43:02 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6449=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6449> : inlines <6990> : streams
 <1808454> : uri <2771360>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33887
Cc: Eli Zaretskii <eliz@HIDDEN>, 33887 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> > Why was sgml-syntax-propertize-inside added?  Is its effect an
>> > absolute must, or merely a nice-to-have feature?
>> It's needed for correctness in the presence of <?...?> or <![CDATA[...]]>
> I use both in some of my XML files and I have never found any issue
> with them. Or perhaps this is just for particular cases?

Yes, it only makes a real difference when the content of those things
ends up confusing the parser (e.g. it looks like an unclosed tag, or
things along these lines).


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33887; Package emacs. Full text available.

Message received at 33887 <at> debbugs.gnu.org:


Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 18:43:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 27 13:43:13 2018
Received: from localhost ([127.0.0.1]:39538 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcacf-00081c-B2
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 13:43:13 -0500
Received: from joooj.vinc17.net ([155.133.131.76]:40490)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <vincent@HIDDEN>) id 1gcaca-00081R-5X
 for 33887 <at> debbugs.gnu.org; Thu, 27 Dec 2018 13:43:08 -0500
Received: from smtp-zira.vinc17.net (jlefevre.net1.nerim.net [80.65.226.245])
 by joooj.vinc17.net (Postfix) with ESMTPSA id D457A2DD;
 Thu, 27 Dec 2018 19:43:02 +0100 (CET)
Received: by zira.vinc17.org (Postfix, from userid 1000)
 id 102E1C207A9; Thu, 27 Dec 2018 19:43:02 +0100 (CET)
Date: Thu, 27 Dec 2018 19:43:02 +0100
From: Vincent Lefevre <vincent@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#33887: 26.1; Emacs hangs for several seconds when going to
 the end of an XML file in nXML mode
Message-ID: <20181227184302.GG2581@HIDDEN>
References: <87ftujuvkd.fsf@HIDDEN> <83imzf6jr4.fsf@HIDDEN>
 <jwvo997x773.fsf-monnier+emacsbugs@HIDDEN>
 <83ftui7wf1.fsf@HIDDEN>
 <jwv8t0a27yy.fsf-monnier+emacsbugs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <jwv8t0a27yy.fsf-monnier+emacsbugs@HIDDEN>
X-Mailer-Info: https://www.vinc17.net/mutt/
User-Agent: Mutt/1.11.1+41 (02252dac) vl-114013 (2018-12-13)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 33887
Cc: Eli Zaretskii <eliz@HIDDEN>, 33887 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 2018-12-27 12:32:21 -0500, Stefan Monnier wrote:
> > Why was sgml-syntax-propertize-inside added?  Is its effect an
> > absolute must, or merely a nice-to-have feature?
> 
> It's needed for correctness in the presence of <?...?> or <![CDATA[...]]>

I use both in some of my XML files and I have never found any issue
with them. Or perhaps this is just for particular cases?

-- 
Vincent Lefèvre <vincent@HIDDEN> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33887; Package emacs. Full text available.

Message received at 33887 <at> debbugs.gnu.org:


Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 17:47:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 27 12:47:41 2018
Received: from localhost ([127.0.0.1]:39521 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcZkz-0006gJ-Iv
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 12:47:41 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57870)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1gcZky-0006g3-8w
 for 33887 <at> debbugs.gnu.org; Thu, 27 Dec 2018 12:47:40 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1gcZko-0006n2-RS
 for 33887 <at> debbugs.gnu.org; Thu, 27 Dec 2018 12:47:34 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42144)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1gcZko-0006mq-OC; Thu, 27 Dec 2018 12:47:30 -0500
Received: from [176.228.60.248] (port=2307 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1gcZko-0002Bg-Br; Thu, 27 Dec 2018 12:47:30 -0500
Date: Thu, 27 Dec 2018 19:47:29 +0200
Message-Id: <83bm567tfy.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwv8t0a27yy.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Thu, 27 Dec 2018 12:32:21 -0500)
Subject: Re: bug#33887: 26.1;
 Emacs hangs for several seconds when going to the end of an XML file
 in nXML mode
References: <87ftujuvkd.fsf@HIDDEN> <83imzf6jr4.fsf@HIDDEN>
 <jwvo997x773.fsf-monnier+emacsbugs@HIDDEN> <83ftui7wf1.fsf@HIDDEN>
 <jwv8t0a27yy.fsf-monnier+emacsbugs@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33887
Cc: vincent@HIDDEN, 33887 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: vincent@HIDDEN, 33887 <at> debbugs.gnu.org
> Date: Thu, 27 Dec 2018 12:32:21 -0500
> 
> > If the latter, perhaps a defcustom that could disable that call will
> > be an okay solution, at least as a stopgap?
> 
> I don't think it should be terribly expensive, so I'd rather first try
> and better understand the performance issue,

Sure.  I thought you already did ;-)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33887; Package emacs. Full text available.

Message received at 33887 <at> debbugs.gnu.org:


Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 17:32:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 27 12:32:25 2018
Received: from localhost ([127.0.0.1]:39513 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcZWD-0006IQ-EH
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 12:32:25 -0500
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:52802)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1gcZWB-0006IF-2m
 for 33887 <at> debbugs.gnu.org; Thu, 27 Dec 2018 12:32:23 -0500
Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wBRHWMaO007291;
 Thu, 27 Dec 2018 12:32:22 -0500
Received: by pastel.home (Postfix, from userid 20848)
 id D7F3B6A505; Thu, 27 Dec 2018 12:32:21 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#33887: 26.1;
 Emacs hangs for several seconds when going to the end of an XML file
 in nXML mode
Message-ID: <jwv8t0a27yy.fsf-monnier+emacsbugs@HIDDEN>
References: <87ftujuvkd.fsf@HIDDEN> <83imzf6jr4.fsf@HIDDEN>
 <jwvo997x773.fsf-monnier+emacsbugs@HIDDEN> <83ftui7wf1.fsf@HIDDEN>
Date: Thu, 27 Dec 2018 12:32:21 -0500
In-Reply-To: <83ftui7wf1.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 27 Dec
 2018 18:43:14 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6448=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6448> : inlines <6990> : streams
 <1808359> : uri <2770879>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33887
Cc: vincent@HIDDEN, 33887 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Why was sgml-syntax-propertize-inside added?  Is its effect an
> absolute must, or merely a nice-to-have feature?

It's needed for correctness in the presence of <?...?> or <![CDATA[...]]>

> If the latter, perhaps a defcustom that could disable that call will
> be an okay solution, at least as a stopgap?

I don't think it should be terribly expensive, so I'd rather first try
and better understand the performance issue,


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33887; Package emacs. Full text available.

Message received at 33887 <at> debbugs.gnu.org:


Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 16:43:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 27 11:43:25 2018
Received: from localhost ([127.0.0.1]:39487 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcYkn-00050d-MU
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:43:25 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54579)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1gcYkm-00050Q-UQ
 for 33887 <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:43:25 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1gcYke-0001ng-67
 for 33887 <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:43:19 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40988)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1gcYkc-0001nS-Va; Thu, 27 Dec 2018 11:43:15 -0500
Received: from [176.228.60.248] (port=2118 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1gcYkc-0005B8-J3; Thu, 27 Dec 2018 11:43:14 -0500
Date: Thu, 27 Dec 2018 18:43:14 +0200
Message-Id: <83ftui7wf1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvo997x773.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Thu, 27 Dec 2018 11:39:06 -0500)
Subject: Re: bug#33887: 26.1;
 Emacs hangs for several seconds when going to the end of an XML file
 in nXML mode
References: <87ftujuvkd.fsf@HIDDEN> <83imzf6jr4.fsf@HIDDEN>
 <jwvo997x773.fsf-monnier+emacsbugs@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33887
Cc: vincent@HIDDEN, 33887 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: Vincent Lefevre <vincent@HIDDEN>, 33887 <at> debbugs.gnu.org
> Date: Thu, 27 Dec 2018 11:39:06 -0500
> 
> > The profile (see below) blames syntax-ppss called by
> > sgml-syntax-propertize, so I suspect commit 0055190, which added
> > sgml-syntax-propertize-inside to sgml-syntax-propertize.
> 
> Sounds right, but I'm not sure what to do about this.
> I don't wonder why so much time is passed on syntax-ppss, which is
> generally expected to be relatively fast.

Why was sgml-syntax-propertize-inside added?  Is its effect an
absolute must, or merely a nice-to-have feature?  If the latter,
perhaps a defcustom that could disable that call will be an okay
solution, at least as a stopgap?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33887; Package emacs. Full text available.

Message received at 33887 <at> debbugs.gnu.org:


Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 16:39:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 27 11:39:12 2018
Received: from localhost ([127.0.0.1]:39480 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcYgh-0004uG-Ma
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:39:12 -0500
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:51334)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1gcYge-0004u8-S8
 for 33887 <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:39:09 -0500
Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca
 [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wBRGd6Kg001933;
 Thu, 27 Dec 2018 11:39:07 -0500
Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848)
 id 6EFB4AE0D0; Thu, 27 Dec 2018 11:39:06 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#33887: 26.1;
 Emacs hangs for several seconds when going to the end of an XML file
 in nXML mode
Message-ID: <jwvo997x773.fsf-monnier+emacsbugs@HIDDEN>
References: <87ftujuvkd.fsf@HIDDEN> <83imzf6jr4.fsf@HIDDEN>
Date: Thu, 27 Dec 2018 11:39:06 -0500
In-Reply-To: <83imzf6jr4.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 27 Dec
 2018 18:02:07 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6448=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6448> : inlines <6990> : streams
 <1808356> : uri <2770859>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33887
Cc: Vincent Lefevre <vincent@HIDDEN>, 33887 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> When I open a large XML file and immediately go to the end of the
>> file with '<ESC> >', Emacs hangs for several seconds. For instance,
>> on /usr/share/xml/iso-codes/iso_639-3.xml from iso-codes in Debian
>> (a 1-MB file), it takes 5 seconds. On a 4-MB personal XML file, it
>> takes 15 seconds.
>> 
>> This is a regression: Emacs 25 did not hang at all.
>
> Confirmed, thanks.
>
> The profile (see below) blames syntax-ppss called by
> sgml-syntax-propertize, so I suspect commit 0055190, which added
> sgml-syntax-propertize-inside to sgml-syntax-propertize.

Sounds right, but I'm not sure what to do about this.
I don't wonder why so much time is passed on syntax-ppss, which is
generally expected to be relatively fast.
Maybe sgml-syntax-propertize is called too often (I see it's mostly
called from skip-syntax-forward; maybe we should call syntax-propertize
explicitly beforehand with a more distant position so
sgml-syntax-propertize is called just once).


        Stefan


> Here's the profile:
>
>   - command-execute                                                 532  77%
>    - call-interactively                                             532  77%
>     - funcall-interactively                                         522  75%
>      - end-of-buffer                                                500  72%
>       - recenter                                                    496  71%
>        - jit-lock-function                                          496  71%
> 	- jit-lock-fontify-now                                      496  71%
> 	 - jit-lock--run-functions                                  496  71%
> 	  - run-hook-wrapped                                        496  71%
> 	   - #<compiled 0x200000000b3a7fd0>                         496  71%
> 	    - font-lock-fontify-region                              496  71%
> 	     - font-lock-default-fontify-region                     496  71%
> 	      - nxml-extend-region                                  496  71%
> 	       - skip-syntax-forward                                496  71%
> 		- internal--syntax-propertize                       496  71%
> 		 - syntax-propertize                                496  71%
> 		  - sgml-syntax-propertize                          490  71%
> 		     syntax-ppss                                    445  64%
> 	push-mark                                                     1   0%
>      - find-file                                                     20   2%
>       - find-file-noselect                                           20   2%
>        - find-file-noselect-1                                        19   2%
> 	- after-find-file                                            17   2%
> 	 - normal-mode                                               17   2%
> 	  - set-auto-mode                                            17   2%
> 	   - set-auto-mode-0                                         17   2%
> 	    - xml-mode                                               17   2%
> 	     - byte-code                                             14   2%
> 	      - require                                              12   1%
> 	       - byte-code                                           11   1%
> 		- require                                            10   1%
> 		 - byte-code                                          9   1%
> 		  - require                                           6   0%
> 		   - byte-code                                        6   0%
> 		    - cl-generic-define-method                        4   0%
> 		     - cl--generic-make-function                      4   0%
> 		      - cl--generic-make-next-function                  4   0%
> 		       - cl--generic-get-dispatcher                   4   0%
> 			- byte-compile                                3   0%
> 			   byte-code                                  1   0%
> 			 - #<compiled 0x200000000b325048>                  1   0%
> 			    byte-compile-top-level                    1   0%
> 		  - custom-declare-variable                           1   0%
> 		   - custom-initialize-reset                          1   0%
> 		    - eval                                            1   0%
> 		     - funcall                                        1   0%
> 		      - #<compiled 0x200000000b3c88b8>                  1   0%
> 		       - executable-find                              1   0%
> 			  locate-file                                 1   0%
> 		 file-truename                                        1   0%
> 	     - rng-nxml-mode-init                                     2   0%
> 	      - rng-validate-mode                                     2   0%
> 	       - rng-auto-set-schema                                  2   0%
> 		- rng-locate-schema-file                              2   0%
> 		 - rng-locate-schema-file-using                       2   0%
> 		  - rng-get-parsed-schema-locating-file                  2   0%
> 		   - rng-parse-schema-locating-file                   1   0%
> 		    - rng-parse-validate-file                         1   0%
> 		     - nxml-parse-instance                            1   0%
> 			nxml-parse-instance-1                         1   0%
> 	     - file-truename                                          1   0%
> 	      - file-truename                                         1   0%
> 	       - file-truename                                        1   0%
> 		  file-truename                                       1   0%
> 	- insert-file-contents                                        1   0%
> 	   xml-find-file-coding-system                                1   0%
>      - execute-extended-command                                       1   0%
>       - sit-for                                                       1   0%
> 	 redisplay                                                    1   0%
>      - minibuffer-complete                                            1   0%
>       - completion-in-region                                          1   0%
>        - completion--in-region                                        1   0%
> 	- #<compiled 0x2000000001b04c20>                              1   0%
> 	 - apply                                                      1   0%
> 	  - #<compiled 0x20000000013baac8>                            1   0%
> 	   - completion--in-region-1                                  1   0%
> 	    - completion--do-completion                               1   0%
> 	     - completion-try-completion                              1   0%
> 	      - completion--nth-completion                            1   0%
> 	       - completion--some                                     1   0%
> 		- #<compiled 0x2000000001b0bd20>                      1   0%
> 		 - completion-basic-try-completion                    1   0%
> 		  - try-completion                                    1   0%
> 		     completion-file-name-table                       1   0%
>     - byte-code                                                      10   1%
>      - read-extended-command                                          9   1%
>       - completing-read                                               9   1%
>        - completing-read-default                                      9   1%
> 	  read-from-minibuffer                                        9   1%
>      - find-file-read-args                                            1   0%
>       - read-file-name                                                1   0%
>        - read-file-name-default                                       1   0%
> 	- completing-read                                             1   0%
> 	 - completing-read-default                                    1   0%
> 	  - read-from-minibuffer                                      1   0%
> 	   - redisplay_internal (C function)                          1   0%
> 	      find-image                                              1   0%
>   - ...                                                             158  22%
>      Automatic GC                                                   156  22%
>    - macroexp--all-forms                                              1   0%
>     - macroexp--expand-all                                            1   0%
>      - #<compiled 0x2000000001375130>                                 1   0%
>       - macroexp--all-forms                                           1   0%
>        - macroexp--expand-all                                         1   0%
> 	- macroexp--all-forms                                         1   0%
> 	 - macroexp--expand-all                                       1   0%
> 	  - #<compiled 0x2000000001375130>                            1   0%
> 	   - macroexp--all-forms                                      1   0%
> 	    - macroexp--expand-all                                    1   0%
> 	     - #<compiled 0x2000000001375068>                         1   0%
> 	      - macroexp--all-forms                                   1   0%
> 	       - macroexp--expand-all                                 1   0%
> 		- macroexp-macroexpand                                1   0%
> 		 - macroexpand                                        1   0%
> 		    #<compiled 0x20000000013f0600>                    1   0%
>    - rng-compute-start-tag-open-deriv                                 1   0%
>     - rng-element-get-child                                           1   0%
>      - rng-compile                                                    1   0%
>       - apply                                                         1   0%
>        - rng-compile-group                                            1   0%
> 	- mapcar                                                      1   0%
> 	 - rng-compile                                                1   0%
> 	  - apply                                                     1   0%
> 	   - rng-compile-attribute                                    1   0%
> 	    - rng-compile                                             1   0%
> 	     - apply                                                  1   0%
> 	      - rng-compile-ref                                       1   0%
> 	       - rng-compile                                          1   0%
> 		- apply                                               1   0%
> 		 - rng-compile-data                                   1   0%
> 		    rng-compile-dt                                    1   0%




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33887; Package emacs. Full text available.

Message received at 33887 <at> debbugs.gnu.org:


Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 16:02:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 27 11:02:31 2018
Received: from localhost ([127.0.0.1]:39468 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcY79-00042O-Dn
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:02:31 -0500
Received: from eggs.gnu.org ([208.118.235.92]:36697)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1gcY73-000425-1h
 for 33887 <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:02:26 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1gcY6s-00017u-2X
 for 33887 <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:02:15 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40386)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1gcY6r-00017o-Va; Thu, 27 Dec 2018 11:02:10 -0500
Received: from [176.228.60.248] (port=3563 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1gcY6q-0003ML-7O; Thu, 27 Dec 2018 11:02:09 -0500
Date: Thu, 27 Dec 2018 18:02:07 +0200
Message-Id: <83imzf6jr4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Vincent Lefevre <vincent@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-reply-to: <87ftujuvkd.fsf@HIDDEN> (message from Vincent Lefevre on
 Thu, 27 Dec 2018 11:13:06 +0100)
Subject: Re: bug#33887: 26.1;
 Emacs hangs for several seconds when going to the end of an XML file
 in nXML mode
References: <87ftujuvkd.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33887
Cc: 33887 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Vincent Lefevre <vincent@HIDDEN>
> Date: Thu, 27 Dec 2018 11:13:06 +0100
> 
> When I open a large XML file and immediately go to the end of the
> file with '<ESC> >', Emacs hangs for several seconds. For instance,
> on /usr/share/xml/iso-codes/iso_639-3.xml from iso-codes in Debian
> (a 1-MB file), it takes 5 seconds. On a 4-MB personal XML file, it
> takes 15 seconds.
> 
> This is a regression: Emacs 25 did not hang at all.

Confirmed, thanks.

The profile (see below) blames syntax-ppss called by
sgml-syntax-propertize, so I suspect commit 0055190, which added
sgml-syntax-propertize-inside to sgml-syntax-propertize.

CC'ing Stefan who made those changes.

Here's the profile:

  - command-execute                                                 532  77%
   - call-interactively                                             532  77%
    - funcall-interactively                                         522  75%
     - end-of-buffer                                                500  72%
      - recenter                                                    496  71%
       - jit-lock-function                                          496  71%
	- jit-lock-fontify-now                                      496  71%
	 - jit-lock--run-functions                                  496  71%
	  - run-hook-wrapped                                        496  71%
	   - #<compiled 0x200000000b3a7fd0>                         496  71%
	    - font-lock-fontify-region                              496  71%
	     - font-lock-default-fontify-region                     496  71%
	      - nxml-extend-region                                  496  71%
	       - skip-syntax-forward                                496  71%
		- internal--syntax-propertize                       496  71%
		 - syntax-propertize                                496  71%
		  - sgml-syntax-propertize                          490  71%
		     syntax-ppss                                    445  64%
	push-mark                                                     1   0%
     - find-file                                                     20   2%
      - find-file-noselect                                           20   2%
       - find-file-noselect-1                                        19   2%
	- after-find-file                                            17   2%
	 - normal-mode                                               17   2%
	  - set-auto-mode                                            17   2%
	   - set-auto-mode-0                                         17   2%
	    - xml-mode                                               17   2%
	     - byte-code                                             14   2%
	      - require                                              12   1%
	       - byte-code                                           11   1%
		- require                                            10   1%
		 - byte-code                                          9   1%
		  - require                                           6   0%
		   - byte-code                                        6   0%
		    - cl-generic-define-method                        4   0%
		     - cl--generic-make-function                      4   0%
		      - cl--generic-make-next-function                  4   0%
		       - cl--generic-get-dispatcher                   4   0%
			- byte-compile                                3   0%
			   byte-code                                  1   0%
			 - #<compiled 0x200000000b325048>                  1   0%
			    byte-compile-top-level                    1   0%
		  - custom-declare-variable                           1   0%
		   - custom-initialize-reset                          1   0%
		    - eval                                            1   0%
		     - funcall                                        1   0%
		      - #<compiled 0x200000000b3c88b8>                  1   0%
		       - executable-find                              1   0%
			  locate-file                                 1   0%
		 file-truename                                        1   0%
	     - rng-nxml-mode-init                                     2   0%
	      - rng-validate-mode                                     2   0%
	       - rng-auto-set-schema                                  2   0%
		- rng-locate-schema-file                              2   0%
		 - rng-locate-schema-file-using                       2   0%
		  - rng-get-parsed-schema-locating-file                  2   0%
		   - rng-parse-schema-locating-file                   1   0%
		    - rng-parse-validate-file                         1   0%
		     - nxml-parse-instance                            1   0%
			nxml-parse-instance-1                         1   0%
	     - file-truename                                          1   0%
	      - file-truename                                         1   0%
	       - file-truename                                        1   0%
		  file-truename                                       1   0%
	- insert-file-contents                                        1   0%
	   xml-find-file-coding-system                                1   0%
     - execute-extended-command                                       1   0%
      - sit-for                                                       1   0%
	 redisplay                                                    1   0%
     - minibuffer-complete                                            1   0%
      - completion-in-region                                          1   0%
       - completion--in-region                                        1   0%
	- #<compiled 0x2000000001b04c20>                              1   0%
	 - apply                                                      1   0%
	  - #<compiled 0x20000000013baac8>                            1   0%
	   - completion--in-region-1                                  1   0%
	    - completion--do-completion                               1   0%
	     - completion-try-completion                              1   0%
	      - completion--nth-completion                            1   0%
	       - completion--some                                     1   0%
		- #<compiled 0x2000000001b0bd20>                      1   0%
		 - completion-basic-try-completion                    1   0%
		  - try-completion                                    1   0%
		     completion-file-name-table                       1   0%
    - byte-code                                                      10   1%
     - read-extended-command                                          9   1%
      - completing-read                                               9   1%
       - completing-read-default                                      9   1%
	  read-from-minibuffer                                        9   1%
     - find-file-read-args                                            1   0%
      - read-file-name                                                1   0%
       - read-file-name-default                                       1   0%
	- completing-read                                             1   0%
	 - completing-read-default                                    1   0%
	  - read-from-minibuffer                                      1   0%
	   - redisplay_internal (C function)                          1   0%
	      find-image                                              1   0%
  - ...                                                             158  22%
     Automatic GC                                                   156  22%
   - macroexp--all-forms                                              1   0%
    - macroexp--expand-all                                            1   0%
     - #<compiled 0x2000000001375130>                                 1   0%
      - macroexp--all-forms                                           1   0%
       - macroexp--expand-all                                         1   0%
	- macroexp--all-forms                                         1   0%
	 - macroexp--expand-all                                       1   0%
	  - #<compiled 0x2000000001375130>                            1   0%
	   - macroexp--all-forms                                      1   0%
	    - macroexp--expand-all                                    1   0%
	     - #<compiled 0x2000000001375068>                         1   0%
	      - macroexp--all-forms                                   1   0%
	       - macroexp--expand-all                                 1   0%
		- macroexp-macroexpand                                1   0%
		 - macroexpand                                        1   0%
		    #<compiled 0x20000000013f0600>                    1   0%
   - rng-compute-start-tag-open-deriv                                 1   0%
    - rng-element-get-child                                           1   0%
     - rng-compile                                                    1   0%
      - apply                                                         1   0%
       - rng-compile-group                                            1   0%
	- mapcar                                                      1   0%
	 - rng-compile                                                1   0%
	  - apply                                                     1   0%
	   - rng-compile-attribute                                    1   0%
	    - rng-compile                                             1   0%
	     - apply                                                  1   0%
	      - rng-compile-ref                                       1   0%
	       - rng-compile                                          1   0%
		- apply                                               1   0%
		 - rng-compile-data                                   1   0%
		    rng-compile-dt                                    1   0%




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33887; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Dec 2018 10:13:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 27 05:13:34 2018
Received: from localhost ([127.0.0.1]:38194 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcSfW-0007aC-Ew
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 05:13:34 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57942)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <vincent@HIDDEN>) id 1gcSfU-0007Zy-PG
 for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 05:13:33 -0500
Received: from lists.gnu.org ([208.118.235.17]:43018)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <vincent@HIDDEN>) id 1gcSfO-000851-Oe
 for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 05:13:26 -0500
Received: from eggs.gnu.org ([208.118.235.92]:50633)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <vincent@HIDDEN>) id 1gcSfN-0000HX-F6
 for bug-gnu-emacs@HIDDEN; Thu, 27 Dec 2018 05:13:26 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <vincent@HIDDEN>) id 1gcSfH-0007zL-Ee
 for bug-gnu-emacs@HIDDEN; Thu, 27 Dec 2018 05:13:23 -0500
Received: from joooj.vinc17.net ([2001:4b99:1:3:216:3eff:fe20:ac98]:43434)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <vincent@HIDDEN>) id 1gcSfF-0007lq-7a
 for bug-gnu-emacs@HIDDEN; Thu, 27 Dec 2018 05:13:17 -0500
Received: from smtp-zira.vinc17.net (jlefevre.net1.nerim.net [80.65.226.245])
 by joooj.vinc17.net (Postfix) with ESMTPSA id 20A8D2DD;
 Thu, 27 Dec 2018 11:13:08 +0100 (CET)
Received: by zira.vinc17.org (Postfix, from userid 1000)
 id 804CAC218C3; Thu, 27 Dec 2018 11:13:06 +0100 (CET)
From: Vincent Lefevre <vincent@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 26.1;
 Emacs hangs for several seconds when going to the end of an XML file
 in nXML mode
Date: Thu, 27 Dec 2018 11:13:06 +0100
Message-ID: <87ftujuvkd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2001:4b99:1:3:216:3eff:fe20:ac98
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)


When I open a large XML file and immediately go to the end of the
file with '<ESC> >', Emacs hangs for several seconds. For instance,
on /usr/share/xml/iso-codes/iso_639-3.xml from iso-codes in Debian
(a 1-MB file), it takes 5 seconds. On a 4-MB personal XML file, it
takes 15 seconds.

This is a regression: Emacs 25 did not hang at all.


In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.2)
 of 2018-12-26, modified by Debian built on x86-ubc-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description:	Debian GNU/Linux buster/sid

Recent messages:
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...done
Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...done
Loading /etc/emacs/site-start.d/50maxima-emacs.el (source)...done
Loading /etc/emacs/site-start.d/50psvn.el (source)...done
Loading /etc/emacs/site-start.d/50python-docutils.el (source)...done
Loading /etc/emacs/site-start.d/50texlive-lang-english.el (source)...done
Loading /etc/emacs/site-start.d/50why3.el (source)...done
Loading /home/vinc17/share/emacs/site-lisp/mutteditor.el (source)...done
Loading time...done
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
 --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-3ThesY/emacs-26.1+1=.
 -fstack-protector-strong -Wformat -Werror=format-security -Wall'
 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LC_COLLATE: POSIX
  value of $LC_CTYPE: en_US.UTF-8
  value of $LC_TIME: en_DK
  value of $LANG: POSIX
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  display-time-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-3.6/tablegen-mode
/usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-3.6/llvm-mode
/usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-3.6/emacs
/usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-3.7/tablegen-mode
/usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-3.7/llvm-mode
/usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-3.7/emacs
/usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-3.8/tablegen-mode
/usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-3.8/llvm-mode
/usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-3.8/emacs
/usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-3.9/tablegen-mode
/usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-3.9/llvm-mode
/usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-3.9/emacs
/usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-4.0/tablegen-mode
/usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-4.0/llvm-mode
/usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-4.0/emacs
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/26.1/lisp/textmodes/rst
/usr/share/emacs/site-lisp/latex-cjk-thai/thai-word hides /usr/share/emacs/26.1/lisp/language/thai-word

Features:
(shadow sort mail-extr warnings emacsbug message rmc puny seq byte-opt
gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822
mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util
rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils elec-pair time cus-start cus-load paren
cc-styles cc-align cc-engine cc-vars cc-defs edmacro kmacro cl-loaddefs
cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 118562 10618)
 (symbols 48 23199 1)
 (miscs 40 54 133)
 (strings 32 34944 2101)
 (string-bytes 1 946046)
 (vectors 16 15937)
 (vector-slots 8 510844 4784)
 (floats 8 56 97)
 (intervals 56 279 0)
 (buffers 992 12))




Acknowledgement sent to Vincent Lefevre <vincent@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#33887; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 8 Jan 2019 22:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.