* Re: Performance issue when fontifing in compile-mode.
[not found] <mailman.12.1295364223.21909.help-gnu-emacs@gnu.org>
@ 2011-01-19 21:49 ` Stefan Monnier
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2011-01-19 21:49 UTC (permalink / raw)
To: help-gnu-emacs
> But logs with >2000 lines take 2-20 sec on parsing after revert.
Hmm... 2s might be OK but 20s sounds too high (tho, clearly the time
will be proportional to the length of the text): what file size are we
talking about for the 20s case?
> (setq compilation-error-regexp-alist nil)
> it match faster parse file!
No doubt that will be faster.
> With '(setq compilation-error-regexp-alist nil)' I still get blue text in
> start of string before ':'.
> Who make this?
compilation-mode-font-lock-keywords
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Performance issue when fontifing in compile-mode.
@ 2011-01-18 15:23 Oleksandr Gavenko
2011-01-18 15:57 ` Oleksandr Gavenko
0 siblings, 1 reply; 3+ messages in thread
From: Oleksandr Gavenko @ 2011-01-18 15:23 UTC (permalink / raw)
To: help-gnu-emacs
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?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Performance issue when fontifing in compile-mode.
2011-01-18 15:23 Oleksandr Gavenko
@ 2011-01-18 15:57 ` Oleksandr Gavenko
0 siblings, 0 replies; 3+ messages in thread
From: Oleksandr Gavenko @ 2011-01-18 15:57 UTC (permalink / raw)
To: help-gnu-emacs
On 18.01.2011 17:23, Oleksandr Gavenko wrote:
> 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.
>
To test you can use shell script:
echo "-*- mode: compilation-minor -*-" >test.txt
seq 1 10000 | while read line; do echo "src/file.c:345: dummy text"
>>test.txt; done
and open test.txt file. It take 20 sec to be opened!
Same with
-*- mode: grep -*-
It is too long for parsing simple 270 KiB of text!!!!!
Which things have affect on performance?
regex parsing or putting properties to buffer text?
Is that true: c-mode highlights only part on file not all?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-19 21:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.12.1295364223.21909.help-gnu-emacs@gnu.org>
2011-01-19 21:49 ` Performance issue when fontifing in compile-mode Stefan Monnier
2011-01-18 15:23 Oleksandr Gavenko
2011-01-18 15:57 ` Oleksandr Gavenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).