From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: open large file with C code: is it realy should be so slow? Date: Tue, 06 Jan 2009 16:50:38 -0500 Message-ID: References: <2a382c6e0901041407w2ca824cdy88d1529af8966069@mail.gmail.com> <20090106190357.GC5612@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1231278672 28832 80.91.229.12 (6 Jan 2009 21:51:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Jan 2009 21:51:12 +0000 (UTC) Cc: bug-cc-mode@gnu.org, Richard M Stallman , Dave Milter , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 06 22:52:23 2009 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 1LKJqL-0004Cb-Sn for ged-emacs-devel@m.gmane.org; Tue, 06 Jan 2009 22:52:10 +0100 Original-Received: from localhost ([127.0.0.1]:51882 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKJp6-0007B3-8o for ged-emacs-devel@m.gmane.org; Tue, 06 Jan 2009 16:50:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKJp1-0007Am-8R for emacs-devel@gnu.org; Tue, 06 Jan 2009 16:50:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKJp0-0007Aa-Pi for emacs-devel@gnu.org; Tue, 06 Jan 2009 16:50:46 -0500 Original-Received: from [199.232.76.173] (port=52126 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKJp0-0007AX-KB for emacs-devel@gnu.org; Tue, 06 Jan 2009 16:50:46 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:50097) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKJow-0006JB-5p; Tue, 06 Jan 2009 16:50:42 -0500 Original-Received: from alfajor.home (vpn-132-204-232-85.acd.umontreal.ca [132.204.232.85]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n06LocQH021178; Tue, 6 Jan 2009 16:50:38 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id 29C751C83E; Tue, 6 Jan 2009 16:50:38 -0500 (EST) In-Reply-To: <20090106190357.GC5612@muc.de> (Alan Mackenzie's message of "Tue, 6 Jan 2009 19:03:57 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3183=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:107668 Archived-At: > (not cheques getting cashed), and suchlike. When I type, sometimes the > display is quite a few characters behind the keyboard. But pauses like > that don't bother me too much; I just carry on typing, subconsciously > confident that Emacs will cache up soon enough. But that's just me. I can live with them as well, but such files were perfectly editable without any such delays even on much slower processors, not that long ago. So I don't think such delays should be considered acceptable, except in pathological cases. > I'd guess that C Mode slowed down quite a lot in CC Mode 5.30, when the > font locking was taken into CC Mode, with the default decoration level > (3), prioritising accuracy over speed. Since then, I've added a bit of It looks like it indeed. I'm wondering if it was a good decision: maybe I've just learned to live with the previous inaccuracies, but I have the impression that I've seen more font-locking errors with the "new" font-locking than with the old one: maybe it's more accurate, but only as long as its cache doesn't get out-of-date/garbled. More specifically, I still regularly see function definitions that are not properly highlighted (presumably because the cache indicates that it's not at top-level, even tho it is). Also accuracy is basically impossible in the presence of funky CPP macros, and it's already very difficult in actual code, because of things like #if foo { blabla #else blibli; { toto; #endif Emacs has traditionally taken the "shallow" approach, using lexical cues rather than full blown syntactic analysis, and this has served it fairly well. Both approaches have their downsides. Stefan