From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: A significant slowdown calling font-lock-fontify-buffer from a hook Date: Tue, 16 Jul 2013 21:47:11 +0300 Message-ID: <83ehay2vgw.fsf@gnu.org> References: <83ip0a2xlb.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1374000447 11869 80.91.229.3 (16 Jul 2013 18:47:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Jul 2013 18:47:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 16 20:47:27 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UzAHW-0005pW-GB for ged-emacs-devel@m.gmane.org; Tue, 16 Jul 2013 20:47:26 +0200 Original-Received: from localhost ([::1]:53085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzAHW-0000X4-5U for ged-emacs-devel@m.gmane.org; Tue, 16 Jul 2013 14:47:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzAHR-0000VL-VU for emacs-devel@gnu.org; Tue, 16 Jul 2013 14:47:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzAHQ-0000ut-Qe for emacs-devel@gnu.org; Tue, 16 Jul 2013 14:47:21 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:56025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzAHQ-0000ue-Jc for emacs-devel@gnu.org; Tue, 16 Jul 2013 14:47:20 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MQ100K00LHR1W00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Tue, 16 Jul 2013 21:47:06 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MQ100J6LLIIWS50@a-mtaout20.012.net.il>; Tue, 16 Jul 2013 21:47:06 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161943 Archived-At: > From: Juanma Barranquero > Date: Tue, 16 Jul 2013 20:26:56 +0200 > Cc: Emacs developers > > > Is the "calling from a hook" an important part of this issue? > > Doing > > emacs -Q src/xdisp.c > M-x font-lock-fontify-buffer > > I don't see the slowdown. First, you need to turn off global-font-lock-mode before visiting xdisp.c. Second, if you do turn off global-font-lock-mode, invoking font-lock-fontify-buffer will fail in Emacs 24.3. You need to do something like this instead: M-: (let ((c-standard-font-lock-fontify-region-function 'font-lock-default-fontify-region)) (font-lock-fontify-buffer)) RET If I do this in Emacs 24.3 and in the current trunk, I do see a significant slowdown: it takes 18 sec with 24.3, and 72 sec with the current trunk. So I think the invocation from hook is not a factor here, which is a Good Thing, because debugging this will be much simpler ;-)