help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's your favourite *under_publicized* editing feature of Emacs?


From: Oleksandr Gavenko
Subject: Re: What's your favourite *under_publicized* editing feature of Emacs?
Date: Mon, 14 Feb 2011 22:44:48 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

On 2011-02-10 0:32, Thien-Thi Nguyen wrote:
() Oleksandr Gavenko<address@hidden>
() 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!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]