From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: emacs hangs in jit-lock Date: Thu, 30 Nov 2006 10:29:36 +0100 Message-ID: <456EA480.4000206@gmx.at> References: <456C70A0.6060105@gnu.org> <87k61fibk5.fsf@stupidchicken.com> <456C9877.7020905@gnu.org> <20061130001202.GB21945@printf.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1164879179 1022 80.91.229.2 (30 Nov 2006 09:32:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Nov 2006 09:32:59 +0000 (UTC) Cc: Henrik Enberg , Chong Yidong , Sam Steingold , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 30 10:32:56 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GpiHe-0007iA-Cp for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2006 10:32:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpiHd-0003ty-PZ for ged-emacs-devel@m.gmane.org; Thu, 30 Nov 2006 04:32:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GpiG9-0003L6-4n for emacs-devel@gnu.org; Thu, 30 Nov 2006 04:31:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GpiG6-0003JQ-I0 for emacs-devel@gnu.org; Thu, 30 Nov 2006 04:31:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpiG6-0003JB-4o for emacs-devel@gnu.org; Thu, 30 Nov 2006 04:31:10 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1GpiG5-0007hX-Jl for emacs-devel@gnu.org; Thu, 30 Nov 2006 04:31:09 -0500 Original-Received: (qmail invoked by alias); 30 Nov 2006 09:31:07 -0000 Original-Received: from N731P010.adsl.highway.telekom.at (EHLO [62.47.35.74]) [62.47.35.74] by mail.gmx.net (mp046) with SMTP; 30 Nov 2006 10:31:07 +0100 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: Stefan Monnier In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63122 Archived-At: > I motion to change the default of jit-lock-stealth-time to nil. > A non-nil setting may be useful for some situations, but nil is safer and > more desirable for laptop use which is becoming the more prevalent > machines nowadays. I doubt that setting `jit-lock-stealth-time' to nil would solve problems reported as >>then load d-mode.el, associate d-mode with *.d, open all the *.d files >>and try to edit, say, lispbibl.d close to the end of file. and > I see the same thing. The header file below is a simple way to test > it. Just open it and hit C-v, and things will get very slow. > > > > Setting jit-lock-stealth-time to nil makes the problem go away. These are not necessarily the "same things". Suppose both problems were caused by stealth fontification proper. There would not be any need to edit or scroll buffers to observe a slowdown. However, the first author tried to "edit the buffer close to the of file" and the second author did open it and "hit C-v". I can see two common points: (1) The major mode involved was C mode and (2) there was some movement toward the end of a buffer. To check whether a problem is really caused by stealth fontification one has to compare performance with stealth fontification turned off/on but _without_ displaying the involved buffers in a window. To detect whether the slowdown is caused by parsing, it would suffice to open the relative buffers, go to their ends, and stealthily fontify them without displaying them. Finally, to detect whether stealth fontification simply "hangs" set `jit-lock-stealth-verbose' to t. FWIW, I think that Alan's recent change to `beginning-of-defun-raw' is the main culprit for the observed slowdown and it would be very easy to spot it in the indicated way. I don't use stealth fontification, hence defaulting `jit-lock-stealth-time' to nil would just save me one line of my .emacs. On the other hand, it would mean throwing out the child with the bathwater and not cure the real problem.