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: Slow fontification in C mode buffers Date: Sat, 03 Dec 2011 15:19:47 +0200 Message-ID: <83vcpxbxn0.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1322918465 9691 80.91.229.12 (3 Dec 2011 13:21:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 3 Dec 2011 13:21:05 +0000 (UTC) Cc: Alan Mackenzie To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 03 14:21:00 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RWpWV-0003CS-C9 for ged-emacs-devel@m.gmane.org; Sat, 03 Dec 2011 14:20:59 +0100 Original-Received: from localhost ([::1]:39583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWpWU-0000ta-C2 for ged-emacs-devel@m.gmane.org; Sat, 03 Dec 2011 08:20:58 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:59425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWpWR-0000tU-TU for emacs-devel@gnu.org; Sat, 03 Dec 2011 08:20:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RWpWQ-0005UB-VQ for emacs-devel@gnu.org; Sat, 03 Dec 2011 08:20:55 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:59006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWpWQ-0005U7-Ns for emacs-devel@gnu.org; Sat, 03 Dec 2011 08:20:54 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LVM00L00QEQC200@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 03 Dec 2011 15:20:53 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.123.99]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LVM00KLLQERN8F0@a-mtaout20.012.net.il>; Sat, 03 Dec 2011 15:20:52 +0200 (IST) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:146460 Archived-At: Did anyone else notice that scrolling the first time through a very large comment in C mode became extremely slow lately? For example, visit xdisp.c in "emacs -Q", type M-<, then hit C-v several times in quick succession. Then watch in disbelief how long it takes for Emacs to scroll by these several screenfuls. In my case (6.5 year old hardware), I even see the "hourglass cursor" kick in, and the CPU meter shows 100% utilization of one execution unit for about 5 seconds. If you then type M-< and again hit C-v several times, scrolling will be at its usual speed. Scrolling outside of large comments is also reasonably fast, even for the first time. Therefore, my prime suspect is font-lock, which is triggered by the need to display a portion of the buffer that was not fontified yet. This suspicion is corroborated by the fact that jit-stealth font-lock of xdisp.c causes extremely high peaks of CPU usage, and Emacs response time becomes very sluggish. Is there something in C Mode's arrangements for fontification, specifically related to comments, that was changed lately and that can explain this slowdown?