From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#4511: marked as done (23.1; flyspell-mode slow editing near end of big html file) Date: Wed, 23 Sep 2009 23:15:03 +0000 Message-ID: References: <87ws3sgcm1.fsf@blah.blah> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1253747703-5367-0" X-Trace: ger.gmane.org 1253748500 22328 80.91.229.12 (23 Sep 2009 23:28:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Sep 2009 23:28:20 +0000 (UTC) To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 24 01:28:13 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MqbFk-0005j0-AU for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 01:28:04 +0200 Original-Received: from localhost ([127.0.0.1]:48395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqbFj-00043M-LB for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Sep 2009 19:28:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqbEs-0003km-L9 for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2009 19:27:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqbEo-0003i4-T9 for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2009 19:27:10 -0400 Original-Received: from [199.232.76.173] (port=53881 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqbEo-0003hx-Nf for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2009 19:27:06 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34501) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MqbEo-0002ak-4W for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2009 19:27:06 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8NNR38s007100; Wed, 23 Sep 2009 16:27:03 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8NNF3om005378; Wed, 23 Sep 2009 16:15:03 -0700 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 4511 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31420 Archived-At: This is a multi-part message in MIME format... ------------=_1253747703-5367-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Wed, 23 Sep 2009 19:06:04 -0400 with message-id and subject line Re: bug#4511: 23.1; flyspell-mode slow editing near end of= big html file has caused the Emacs bug report #4511, regarding 23.1; flyspell-mode slow editing near end of big html file to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 4511: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D4511 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1253747703-5367-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 21 Sep 2009 22:26:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.9 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8LMQ0SH002482 for ; Mon, 21 Sep 2009 15:26:01 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MprKZ-0001mn-Op for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2009 18:25:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MprKS-0001ma-OJ for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2009 18:25:59 -0400 Received: from [199.232.76.173] (port=55946 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MprKS-0001mX-Jm for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2009 18:25:52 -0400 Received: from mailout2-10.pacific.net.au ([125.255.80.137]:40099 helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MprKR-0007mB-4Z for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2009 18:25:52 -0400 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 1371118DF9D for ; Tue, 22 Sep 2009 08:25:45 +1000 (EST) Received: from blah.blah (ppp2A26.dyn.pacific.net.au [61.8.42.38]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id C13778C0F for ; Tue, 22 Sep 2009 08:25:39 +1000 (EST) Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1MprJG-00019T-LT for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 08:24:38 +1000 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: 23.1; flyspell-mode slow editing near end of big html file Date: Tue, 22 Sep 2009 08:24:38 +1000 Message-ID: <87ws3sgcm1.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) --=-=-= When flyspell-mode is enabled in a big html file, and point is somewhere near the end of the buffer, typing text or moving point with C-f and C-b become sluggish, to the point of being nearly unusable. (This is a regression from emacs 22, where flyspell-mode was fine on such files.) I expect "big file" is relative to cpu speed, but 300 kbytes is bad on my slow pc (not an outrageously huge file). To reproduce try this of about 600 kbytes, (progn (switch-to-buffer "foo") (dotimes (i 50000) (insert (format "

abc def\n" i))) (html-mode) (flyspell-mode)) It takes a few seconds to create the buffer, but of course that's not the bug. The bad bit is if you move point around with C-f / C-b near the end of the buffer, or type some plain text there outside of a , where it's sluggish between keystrokes. (Try upping the 50000 on a fast cpu if necessary.) I track the slowness to where `sgml-mode-flyspell-verify' does (looking-back "<[^>\n]*") I take it this func is asking whether point is within a or not. Does that regexp end up asking re-search-backward to consider every "<" in the buffer or something, before deciding no match is possible? I find it hugely faster to do an old fashioned skip-chars-backward as below -- assuming I'm not mistaken that the "\n" in the existing `looking-back' is supposed mean examining no more than the current line. 2009-09-21 Kevin Ryde * textmodes/flyspell.el (sgml-mode-flyspell-verify): Use skip-chars-backward instead of looking-back, to avoid a very slow regexp match when far into a big buffer with a lots of "<" chars. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=flyspell.el.sgml-verify.diff --- flyspell.el.~1.146.~ 2009-09-18 08:23:13.000000000 +1000 +++ flyspell.el 2009-09-21 16:36:12.000000000 +1000 @@ -363,7 +363,9 @@ "Function used for `flyspell-generic-check-word-predicate' in SGML mode." (not (save-excursion (or (looking-at "[^<\n]*>") - (ispell-looking-back "<[^>\n]*") + (save-excursion + (skip-chars-backward "^<>\n") ;; \n only look at current line + (not (equal ?< (char-before)))) ;; "<" if in a tag (and (looking-at "[^&\n]*;") (ispell-looking-back "&[^;\n]*")))))) --=-=-= In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of 2009-08-03 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t --=-=-=-- ------------=_1253747703-5367-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4511-done) by emacsbugs.donarmstrong.com; 23 Sep 2009 23:06:12 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8NN6ASa004166 for <4511-done@emacsbugs.donarmstrong.com>; Wed, 23 Sep 2009 16:06:11 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsFAD9GukpFpYEz/2dsb2JhbACBUdVmhBsFh34 X-IronPort-AV: E=Sophos;i="4.44,440,1249272000"; d="scan'208";a="46455932" Received: from 69-165-129-51.dsl.teksavvy.com (HELO pastel.home) ([69.165.129.51]) by ironport2-out.pppoe.ca with ESMTP; 23 Sep 2009 19:06:05 -0400 Received: by pastel.home (Postfix, from userid 20848) id DD24F807A; Wed, 23 Sep 2009 19:06:04 -0400 (EDT) From: Stefan Monnier To: Kevin Ryde Subject: Re: bug#4511: 23.1; flyspell-mode slow editing near end of big html file Message-ID: References: <87ws3sgcm1.fsf@blah.blah> <87vdjaa388.fsf@blah.blah> Date: Wed, 23 Sep 2009 19:06:04 -0400 In-Reply-To: (Stefan Monnier's message of "Tue, 22 Sep 2009 23:13:32 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>> You need to pass it a `limit' argument. >> I thought about that a bit. The limit would be the immediately >> preceding "<", ">", or "\n", since whichever of them is hit first >> answers whether you're in a tag or not. > (line-beginning-position) will do fine. Installed, Stefan ------------=_1253747703-5367-0--