From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Dave Milter" Newsgroups: gmane.emacs.devel Subject: Re: open large file with C code: is it realy should be so slow? Date: Mon, 5 Jan 2009 01:07:18 +0300 Message-ID: <2a382c6e0901041407w2ca824cdy88d1529af8966069@mail.gmail.com> References: <2a382c6e0812010201h7a2507fbg66a38f392d9837a9@mail.gmail.com> <20081201123716.GA3603@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1231107234 31706 80.91.229.12 (4 Jan 2009 22:13:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Jan 2009 22:13:54 +0000 (UTC) Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org To: "Alan Mackenzie" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 04 23:15:04 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 1LJbCg-00071d-6E for ged-emacs-devel@m.gmane.org; Sun, 04 Jan 2009 23:14:59 +0100 Original-Received: from localhost ([127.0.0.1]:50158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJbBP-0001DT-E4 for ged-emacs-devel@m.gmane.org; Sun, 04 Jan 2009 17:10:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJb8I-0000dL-6y for emacs-devel@gnu.org; Sun, 04 Jan 2009 17:07:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJb8E-0000cr-Hr for emacs-devel@gnu.org; Sun, 04 Jan 2009 17:07:41 -0500 Original-Received: from [199.232.76.173] (port=56524 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJb8E-0000co-Df for emacs-devel@gnu.org; Sun, 04 Jan 2009 17:07:38 -0500 Original-Received: from mail-bw0-f12.google.com ([209.85.218.12]:58902) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJb84-0000Zg-OP; Sun, 04 Jan 2009 17:07:29 -0500 Original-Received: by bwz5 with SMTP id 5so15736475bwz.18 for ; Sun, 04 Jan 2009 14:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=U/P/KwcHflaVWeJyABOGP44oSjfTGIyroqe/qel5ykI=; b=t6SVuaM0tPTc1c8A6YOF95KC63vT68MoY+UEN4W09ce5kOTLbCFIw0vGZoEawdFMEC 64Y+GcPvwmnCGwh7gGKL8LlzP06KSR74M2eVaWdwHpBam295HaQCxvZEJvofMsx09NkD LGyOIulq2PJ4BzSqT0/b+PBJlEbFWnV/punfs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=BESf72nzv0l7BMJCumLT+aBg4tDqOOjmDlS09qTbha+mVwDkz7j2ZLvYmfID3LXv32 i9nb8QZ+EPCOJuRWb1nQmkUU5PSCX/aa0X1Z69u2JHjXo5k7uoIaxGXrRhML/uYP1sDt ilD/8p5QFg92xa33Hj0swM5xD47zqbJ0wyK4E= Original-Received: by 10.181.30.10 with SMTP id h10mr7827460bkj.200.1231106838722; Sun, 04 Jan 2009 14:07:18 -0800 (PST) Original-Received: by 10.180.210.13 with HTTP; Sun, 4 Jan 2009 14:07:18 -0800 (PST) In-Reply-To: <20081201123716.GA3603@muc.de> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:107582 Archived-At: On Mon, Dec 1, 2008 at 3:37 PM, Alan Mackenzie wrote: > > On Mon, Dec 01, 2008 at 01:01:08PM +0300, Dave Milter wrote: >> I have problem with emacs responsibility, >> I work with large enough C header files, >> and when I want to scroll it using mouse's wheel or >> page (up|down) keys emacs stop react on any keys, like (ctrl+g), >> and eats 100% of CPU's time during long period, >> I wonder is this a bug, or expected behaviour? > > It's a bug. > > Although C Mode works "properly" here, it doesn't seem to be tuned very > well for files like this one (At91SAM9253_inc.h), which contain a lot of > #defines and comments and nothing else. > I made some more testing (to find out problem in "file", or in "large"), because of really want to see this bug fixed, I see the same behaviour on file created by for ((i=0;i<500;++i)); do echo "extern void f${i}(int a${i});"; done emacs from cvs and emacs 22 show the same behaviour - eating 100% of cpu, if make fast scrolling. > >> elp results are: > Function Name Call Count Elapsed Time Average Time ========================================================= ========== ============ ============ font-lock-fontify-region 41 230.65321899 5.6256882682 font-lock-default-fontify-region 41 230.65264900 5.6256743658 font-lock-fontify-keywords-region 41 230.61167599 5.6246750243 font-lock-fontify-syntactically-region 41 0.039573 0.0009651951 font-lock-unfontify-region 41 0.0005050000 1.231...e-05 font-lock-default-unfontify-region 41 0.0001930000 4.707...e-06 font-lock-extend-region-wholelines 41 0.0001080000 2.634...e-06 font-lock-extend-region-multiline 41 9.800...e-05 2.390...e-06 font-lock-set-defaults 41 8.299...e-05 2.024...e-06 font-lock-mode 3 7.6e-05 2.533...e-05 font-lock-default-function 3 1.400...e-05 4.666...e-06 In fact, with small files, for example the same script but 5000 -> 500, I see the same situation, but after eating cpu during some period, it never eating it after, and all works smoothly, while with big files it eats it every fast scroll.