From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: What's your favourite *under_publicized* editing feature of Emacs? Date: Mon, 14 Feb 2011 22:44:48 +0200 Message-ID: References: <4D4F0063.10708@gmail.com> <87tygchmag.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1297716341 12612 80.91.229.12 (14 Feb 2011 20:45:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 14 Feb 2011 20:45:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 14 21:45:36 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pp5Id-000091-U3 for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Feb 2011 21:45:36 +0100 Original-Received: from localhost ([127.0.0.1]:42054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pp5Id-0007ak-Cs for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Feb 2011 15:45:35 -0500 Original-Received: from [140.186.70.92] (port=55825 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pp5IH-0007Xm-09 for help-gnu-emacs@gnu.org; Mon, 14 Feb 2011 15:45:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pp5IF-0006kR-65 for help-gnu-emacs@gnu.org; Mon, 14 Feb 2011 15:45:12 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:59180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pp5IE-0006jz-K5 for help-gnu-emacs@gnu.org; Mon, 14 Feb 2011 15:45:10 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pp5IB-0008H7-0l for help-gnu-emacs@gnu.org; Mon, 14 Feb 2011 21:45:07 +0100 Original-Received: from 209-175-202-46.pool.ukrtel.net ([46.202.175.209]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Feb 2011 21:45:07 +0100 Original-Received: from gavenkoa by 209-175-202-46.pool.ukrtel.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Feb 2011 21:45:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 46 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 209-175-202-46.pool.ukrtel.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 In-Reply-To: <87tygchmag.fsf@ambire.localdomain> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79116 Archived-At: On 2011-02-10 0:32, Thien-Thi Nguyen wrote: > () Oleksandr Gavenko > () Wed, 09 Feb 2011 23:31:15 +0200 > > So because of unnecessary work to set text property to well > structured data on *all* lines we have slow down instead perform > parsing of reference on demand. > > [...] > > Or I am something missing? > > You have well-structured data but the compilation (likewise, grep) > font-locking tries to cope with a more general input. You can prune > some elements from ‘compilation-error-regexp-alist’ to help focus the > font-locking. Have you tried that? > Yes. I wrote: (require 'compile) (setq my-log2-error-regexp-alist '( ("^\\([^:]+\\):\\([[:digit:]]+\\):" 1 2) )) (define-compilation-mode my-log2-mode "MyLog" "Log mode." (set (make-local-variable 'compilation-error-regexp-alist) my-log2-error-regexp-alist) ) And as I describe previously I eval on same 289 KiB long buffer: (benchmark-run 1 (revert-buffer)) and get: (20.937 1 0.109) In contrast to test of 'grep-mode' where I get: (22.406 1 0.156) As I use same regex for derived from compilation mode as for custom highlighting mode I decide that bottle neck lies in setting properties to text. When set only 'face' property - this is fast. But when set 'message' property it is slow as 'message' is complex structure which must recalculated on every matching lines. -- Best regards!