[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Performance issue when fontifing in compile-mode.
From: |
Oleksandr Gavenko |
Subject: |
Performance issue when fontifing in compile-mode. |
Date: |
Tue, 18 Jan 2011 17:23:28 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 |
I use in log file:
-*- mode: compilation-minor; mode: auto-revert-tail; default-directory:
"~/devel" -*-
This allow easy and fast go to place where logger function make output
(in GNU format).
But logs with >2000 lines take 2-20 sec on parsing after revert.
I check 'compilation-error-regexp-alist'. It contain pattern in
alphabetical order!
(like come from 'compilation-error-regexp-alist-alist' ??)
Most of my software produce in 'gnu' format.
As I understand patterns checked in order like in
'compilation-error-regexp-alist'.
And if string is not match any pattern all pattern in
'compilation-error-regexp-alist'
used!
I check which pattern in effect by:
(mapc
(lambda (item)
(when (string-match (elt item 1) " [echo] file.c:45: error gg")
(message "%s" (elt item 0))
))
compilation-error-regexp-alist-alist
)
Also I temporary put this code to .emacs:
(mapc
(lambda (item)
(when (memq item compilation-error-regexp-alist)
(setq compilation-error-regexp-alist
(cons item (assq-delete-all item
compilation-error-regexp-alist)) )
))
;; Most latest firstly used.
'(ant gnu)
)
I try something like:
(setq compilation-error-regexp-alist '(gnu))
and still get same performance (slow).
When I set
(setq compilation-error-regexp-alist nil)
it match faster parse file!
So I try rewrite this regex (add my-gnu pattern before gnu).
(add-to-list 'compilation-error-regexp-alist-alist '(my-gnu
"^\\([^:]+\\):\\([[:digit:]]+\\):" 1 2))
(add-to-list 'compilation-error-regexp-alist 'my-gnu)
It is about 2 time faster then my slow case.
With '(setq compilation-error-regexp-alist nil)' I still get blue text
in start of string before ':'.
Who make this?
- Performance issue when fontifing in compile-mode.,
Oleksandr Gavenko <=