[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
slow output in *compilation* buffer
From: |
Dan Nicolaescu |
Subject: |
slow output in *compilation* buffer |
Date: |
Sat, 22 Aug 2009 01:23:10 -0700 (PDT) |
Running a compilation job the produces a lot of text output with M-x
compile is much slower than running it in a shell.
For example
With emacs/lisp as the current directory, doing
M-x compile RET grep -nH -e emacs *.el */*.el RET
takes 25 seconds
The output is 4500 lines
Running the same command in an xterm takes 1.5 seconds!
gprof data:
% cumulative self self total
time seconds seconds calls s/call s/call name
31.19 2.72 2.72 52618323 0.00 0.00 lookup_char_property
20.30 4.49 1.77 51726150 0.00 0.00 previous_interval
12.16 5.55 1.06 208889310 0.00 0.00 Fcdr
5.85 6.06 0.51 52444384 0.00 0.00 Fassq
5.39 6.53 0.47 4573 0.00 0.00
Fprevious_single_property_change
2.64 6.76 0.23 8860105 0.00 0.00 mark_object
2.52 6.98 0.22 10621 0.00 0.00 Fsetcar
2.29 7.18 0.20 52618300 0.00 0.00 textget
1.83 7.34 0.16 59828 0.00 0.00 re_search_2
1.72 7.49 0.15 305181 0.00 0.00 re_match_2_internal
1.03 7.58 0.09 82087 0.00 0.00 Fbyte_code
0.80 7.65 0.07 9094 0.00 0.00 adjust_for_invis_intang
0.80 7.72 0.07 581767 0.00 0.00 find_interval
0.69 7.78 0.06 295253 0.00 0.00 next_interval
0.69 7.84 0.06 21 0.00 0.02 Fgarbage_collect
0.57 7.89 0.05 23886 0.00 0.00 mark_vectorlike
Observations:
- there's a lot of garbage collection going on
- Fprevious_single_property_change is probably mostly called from
compilation-error-properties
Doing
M-x (setq compilation-error-regexp-alist nil) RET
then
M-x compile RET grep -nH -e emacs *.el */*.el RET
takes 3 seconds.
So it seems that fontification (and things related to it) are very very
expensive.
Can someone familiar with the code in question take a look and figure
out how to optimize this?
Thanks
--dan