emacs-devel
[Top][All Lists]
Advanced

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

Re: Slow fontification in C mode buffers


From: Kan-Ru Chen
Subject: Re: Slow fontification in C mode buffers
Date: Sun, 18 Dec 2011 00:06:00 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Alan Mackenzie <address@hidden> writes:

>> I forgot that I've set font-lock-maximum-decoration to 2. I tested with
>> emacs -Q again. The first font-lock is slow, but pretty fast after
>> that. It occasionally hangs when I C-v the buffer. Below is the
>> elp-results:
>
> You haven't said exactly how many operations, or what, you performed
> before doing elp-results.  In my elp results below, I've:
> (i) Loaded elp and instrumented the c- package.
> (ii) Loaded your file.
> (iii) Done M-x c++-mode
> (iv) Done M-x elp-results (to clear the accumulated times)
> (v) M->
> (vi) M-x elp-results.

Please forgive me for using the other files, it is closer to the real
case. You can get the file from

https://hg.mozilla.org/mozilla-central/raw-file/tip/dom/base/nsDOMClassInfo.cpp

(i) Loaded elp and instrumented the c- package.
(ii) Loaded nsDOMClassInfo.cpp
(iii) Done M-x c++-mode
(iv) Done M-x elp-results (to clear the accumulated times)
(v) C-s battery until failing to find 
(vi) M-x elp-results.

Before:

c-beginning-of-decl-1                          201         13.065947999  
0.0650047164
c-beginning-of-statement-1                     229         13.061191     
0.0570357685
c-crosses-statement-barrier-p                  35466       11.622212999  
0.0003277001
c-font-lock-declarations                       16          9.4090929999  
0.5880683124
c-find-decl-spots                              16          9.4089879999  
0.5880617499

c-at-macro-vsemi-p                             46569       6.6139159999  
0.0001420240
c-in-literal                                   46569       5.4569670000  
0.0001171802
c-literal-limits                               51666       3.1393819999  
6.076...e-05
c-backward-sws                                 176682      1.6644079999  
9.420...e-06
c-beginning-of-macro                           104078      0.5568430000  
5.350...e-06

c-state-safe-place                             72459       0.3154430000  
4.353...e-06
c-parse-state                                  225         0.1421229999  
0.0006316577
c-parse-state-1                                225         0.1385559999  
0.0006158044
c-font-lock-enclosing-decls                    16          0.1365140000  
0.0085321250
c-append-to-state-cache                        196         0.0641449999  
0.0003272704

After:

c-beginning-of-decl-1                          137         9.6732900000  
0.0706079562
c-beginning-of-statement-1                     165         9.6693369999  
0.0586020424
c-crosses-statement-barrier-p                  25584       8.5505400000  
0.0003342143
c-font-lock-declarations                       16          6.059768      
0.3787355
c-find-decl-spots                              16          6.059666      
0.378729125

c-at-macro-vsemi-p                             35149       4.7420429999  
0.0001349126
c-in-literal                                   35149       4.0154739999  
0.0001142414
c-literal-limits                               38962       2.5425719999  
6.525...e-05
c-backward-sws                                 128214      1.1421259999  
8.907...e-06
c-beginning-of-macro                           78145       0.3845660000  
4.921...e-06

c-state-safe-place                             54703       0.2419970000  
4.423...e-06
c-parse-state                                  317         0.1464209999  
0.0004618958
c-font-lock-enclosing-decls                    16          0.137945      
0.0086215625
c-parse-state-1                                317         0.1331939999  
0.0004201703
c-font-lock-declarators                        24          0.065522      
0.0027300833

-- 
Kanru



reply via email to

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