From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Pohlack Newsgroups: gmane.emacs.devel Subject: extremely slow font-lock-mode Date: Tue, 11 Dec 2007 11:25:35 +0100 Message-ID: <475E659F.4000303@os.inf.tu-dresden.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197401558 30868 80.91.229.12 (11 Dec 2007 19:32:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Dec 2007 19:32:38 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 11 20:32:48 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J2AqT-00078i-M7 for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2007 20:32:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2AqB-0004Ni-K2 for ged-emacs-devel@m.gmane.org; Tue, 11 Dec 2007 14:32:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J22Ii-0002CG-Bz for emacs-devel@gnu.org; Tue, 11 Dec 2007 05:25:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J22Ih-0002AE-DJ for emacs-devel@gnu.org; Tue, 11 Dec 2007 05:25:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J22Ig-00029j-Mu for emacs-devel@gnu.org; Tue, 11 Dec 2007 05:25:18 -0500 Original-Received: from os.inf.tu-dresden.de ([141.76.48.99]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J22Ig-0005rd-KA for emacs-devel@gnu.org; Tue, 11 Dec 2007 05:25:18 -0500 Original-Received: from monat.inf.tu-dresden.de ([141.76.48.62]) by os.inf.tu-dresden.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) id 1J22Id-0005ZV-Dv for emacs-devel@gnu.org; Tue, 11 Dec 2007 11:25:15 +0100 User-Agent: Thunderbird 2.0.0.9 (X11/20071115) X-Enigmail-Version: 0.95.5 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Tue, 11 Dec 2007 14:32:22 -0500 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:85063 Archived-At: Hi, I'm experiencing very slow syntax highlighting with emacs-23.0.60 (GTK+ Version 2.12.1). Simply scrolling in source files takes incredibly long (~ 1 second for scolling one line backwards). This is an a dual-core 2 GHZ machine ... I tried to play with all font-lock and jit-lock customization options but only turning font-lock off seemed to make a difference. I tried to use elp to instrument relevant packages (mwheel, font-lock, jit-lock, mouse, lazy-lock, fast-lock). After some scrolling (~ 20 seconds, with pauses, mouse wheel, pg-keys and scrollbar) I get the following results: Function Name Call Count Elapsed Time Average Time ================================== ========== ============ ============ mwheel-scroll 62 4.060767 0.0654962419 jit-lock-function 18 0.0083890000 0.0004660555 jit-lock-fontify-now 18 0.0082680000 0.0004593333 font-lock-fontify-region 18 0.007176 0.0003986666 font-lock-default-fontify-region 18 0.006962 0.0003867777 font-lock-fontify-syntactically-re 18 0.0042169999 0.0002342777 font-lock-fontify-keywords-region 18 0.0020000000 0.0001111111 jit-lock-context-fontify 21 0.0017679999 8.419...e-05 font-lock-mode 14 0.0004470000 3.192...e-05 font-lock-unfontify-region 18 0.000194 1.077...e-05 mwheel-filter-click-events 55 0.0001699999 3.090...e-06 font-lock-prepend-text-property 32 0.0001610000 5.031...e-06 mwheel-event-button 62 0.0001379999 2.225...e-06 mwheel-event-window 62 0.0001349999 2.177...e-06 font-lock-default-function 14 0.0001119999 8e-06 mwheel-inhibit-click-timeout 7 0.000105 1.5e-05 font-lock-change-mode 2 9.5e-05 4.75e-05 font-lock-default-unfontify-region 18 6.500...e-05 3.611...e-06 font-lock-extend-region-multiline 18 4.5e-05 2.5e-06 font-lock-extend-region-wholelines 18 4.4e-05 2.444...e-06 font-lock-set-defaults 18 4.200...e-05 2.333...e-06 mouse-region-match 1 6e-06 6e-06 So, mwheel-scroll seems to behave badly. However, lots of the problematic calls also seem to have been lost. E.g., scrolling with keyboard was also very slow and is not shown in the table. I also noticed, that scrolling forward seems to go considerably faster than scrolling backwards (maybe this has to do with syntax-driven jit-lock?). The results are twofold for me: First, I don't seem to be using elp right or it is the wrong tool. Ideally, I would like to use a /sampling/ profiler for emacs. - Is there such a thing that can look into running lisp code? - How should I be using elp differently for getting meaningful results? Second, font-lock-mode is currently unusable for me. I started emacs with -q, so I don't think my local tweak are to blame. emacs-22 on my local machine is incredibly fast for the same file (also started with -q). - What might be to blame here? - Do you need more details on any aspect of my machine configuration? Cheers, Martin Pohlack