all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kan-Ru Chen <kanru@kanru.info>
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: Re: Slow fontification in C mode buffers
Date: Fri, 16 Dec 2011 10:32:20 +0800	[thread overview]
Message-ID: <87ty51i6vf.fsf@isil.kanru.info> (raw)
In-Reply-To: <20111215181215.GA3464@acm.acm> (Alan Mackenzie's message of "Thu, 15 Dec 2011 18:12:15 +0000")

Alan Mackenzie <acm@muc.de> writes:

> Hello, again.
>
> On Fri, Dec 16, 2011 at 12:16:25AM +0800, Kan-Ru Chen wrote:
>> Alan Mackenzie <acm@muc.de> writes:
>
>> > Would you please try the following patch and let me know how it goes.
>> > Thanks!
>
>> No change. c-cheap-inside-bracelist-p seems not called at all.
>
> Hmm.  The place c-cheap-inside-bracelist-p is inside
> c-font-lock-declarations, it can scarcely avoid being called.
>
> Forgive me for asking you this, but are you sure you byte compiled the
> two files after patching them, etc.?

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:

Function Name                            Call Count  Elapsed Time  Average Time
c-beginning-of-decl-1                    1203        269.68204399  0.2241746001
c-beginning-of-statement-1               1242        269.60064599  0.2170697632
c-crosses-statement-barrier-p            241143      258.95701700  0.0010738732
c-font-lock-declarations                 179         160.73329700  0.8979513798
c-find-decl-spots                        179         160.732037    0.8979443407
c-at-macro-vsemi-p                       336240      159.34210499  0.0004738939
c-in-literal                             336240      150.66956800  0.0004481012
c-slow-in-literal                        336240      149.19536500  0.0004437168
c-literal-limits                         374344      85.649792999  0.0002287996
c-beginning-of-syntax                    522725      73.183792999  0.0001400043
c-font-lock-enclosing-decls              179         57.476122000  0.3210956536
c-backward-sws                           1215297     12.826941000  1.055...e-05
c-beginning-of-macro                     746198      4.2144529999  5.647...e-06
c-parse-state                            3326        1.0435710000  0.0003137615
c-parse-state-1                          3326        0.9558269999  0.0002873803
c-forward-decl-or-cast-1                 2089        0.4252059999  0.0002035452
c-append-to-state-cache                  3178        0.3954000000  0.0001244178
c-font-lock-declarators                  135         0.3788929999  0.0028066148
c-syntactic-re-search-forward            432         0.3418039999  0.0007912129
c-forward-type                           5008        0.2934280000  5.859...e-05
c-remove-stale-state-cache               2819        0.2530829999  8.977...e-05
c-font-lock-<>-arglists                  179         0.1875940000  0.0010480111
c-font-lock-enum-tail                    179         0.1730750000  0.0009668994
c-parse-state-get-strategy               3326        0.149166      4.484...e-05
c-get-fallback-scan-pos                  330         0.1159620000  0.0003514000
c-forward-name                           3509        0.1159080000  3.303...e-05
c-remove-stale-state-cache-backwards     507         0.1071120000  0.0002112662
c-font-lock-complex-decl-prepare         179         0.0924410000  0.0005164301
c-backward-token-2                       6514        0.0913669999  1.402...e-05
c-cheap-inside-bracelist-p               1954        0.0872260000  4.463...e-05
c-state-literal-at                       520         0.0582760000  0.0001120692
c-forward-label                          707         0.0382930000  5.416...e-05
c-at-toplevel-p                          128         0.0342679999  0.0002677187
c-syntactic-content                      2688        0.0300650000  1.118...e-05
c-forward-sws                            8547        0.0256289999  2.998...e-06
c-state-balance-parens-backwards         506         0.0250620000  4.952...e-05
c-search-uplist-for-classkey             128         0.0244740000  0.0001912031
c-looking-at-decl-block                  128         0.0230999999  0.0001804687
c-syntactic-skip-backward                128         0.0213989999  0.0001671796
c-after-conditional                      204         0.0180919999  8.868...e-05
c-beginning-of-current-token             4902        0.0143600000  2.929...e-06
c-get-cache-scan-pos                     3474        0.0119859999  3.450...e-06
c-end-of-macro                           2192        0.0077970000  3.557...e-06
c-syntactic-end-of-macro                 245         0.0049240000  2.009...e-05
c-add-type                               258         0.0042930000  1.663...e-05
c-looking-at-inexpr-block                95          0.0039379999  4.145...e-05
c-forward-annotation                     2089        0.0028189999  1.349...e-06
c-skip-comments-and-strings              1694        0.0025100000  1.481...e-06
c-font-lock-invalid-string               392         0.0018759999  4.785...e-06
c-state-get-min-scan-pos                 3674        0.0011130000  3.029...e-07
c-most-enclosing-brace                   1142        0.0008480000  7.425...e-07
c-fontify-recorded-types-and-refs        475         0.0005930000  1.248...e-06
c-forward-keyword-clause                 33          0.000508      1.539...e-05
c-append-lower-brace-pair-to-state-cache 1           0.00038       0.00038
c-safe-position                          256         0.0003150000  1.230...e-06
c-forward-to-cpp-define-body             32          0.0002930000  9.156...e-06
c-end-of-current-token                   32          6.500...e-05  2.031...e-06
c-leave-cc-mode-mode                     6           1.300...e-05  2.166...e-06
c-forward-single-comment                 2           1e-05         5e-06

-- 
Kanru



  reply	other threads:[~2011-12-16  2:32 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-03 13:19 Slow fontification in C mode buffers Eli Zaretskii
2011-12-03 15:03 ` Sujith
2011-12-03 15:14   ` Eli Zaretskii
2011-12-03 15:32     ` Sujith
2011-12-03 15:18 ` Alan Mackenzie
2011-12-03 16:19   ` Eli Zaretskii
2011-12-13 15:31   ` Kan-Ru Chen
2011-12-14 11:19     ` Alan Mackenzie
2011-12-14 11:30     ` Alan Mackenzie
2011-12-14 12:23       ` Alan Mackenzie
2011-12-14 13:14     ` Alan Mackenzie
2011-12-14 15:02       ` Kan-Ru Chen
2011-12-15 13:43     ` Alan Mackenzie
2011-12-15 16:16       ` Kan-Ru Chen
2011-12-15 18:12         ` Alan Mackenzie
2011-12-16  2:32           ` Kan-Ru Chen [this message]
2011-12-16 11:26             ` Alan Mackenzie
2011-12-17 16:06               ` Kan-Ru Chen
2011-12-21 10:56                 ` Alan Mackenzie
2011-12-21 13:33                   ` Geoff Gole
2011-12-21 16:04                     ` Alan Mackenzie
2011-12-21 16:48                       ` Geoff Gole
2011-12-21 18:06                         ` Alan Mackenzie
2011-12-21 18:16                     ` Eli Zaretskii
2011-12-21 18:32                       ` Geoff Gole
2011-12-21 19:35                         ` Eli Zaretskii
2011-12-23  1:56                     ` Kentaro NAKAZAWA
2011-12-23 12:03                       ` Alan Mackenzie
2012-01-06 22:08                       ` Alan Mackenzie
2012-01-07  0:09                         ` Kentaro NAKAZAWA
2012-01-07 13:50                           ` Alan Mackenzie
2012-01-08  1:26                             ` Kentaro NAKAZAWA
2012-01-08 10:05                               ` Alan Mackenzie
2012-01-20 17:26                               ` Alan Mackenzie
2012-02-06 16:14                                 ` Kentaro NAKAZAWA
2011-12-22 16:06                   ` Kan-Ru Chen
2012-01-13 19:12                 ` Alan Mackenzie
2012-01-14  9:12                   ` Kan-Ru Chen
2012-01-15 21:12                 ` Alan Mackenzie
2012-01-22  4:20                   ` Kan-Ru Chen
2011-12-03 21:15 ` Alan Mackenzie
2011-12-04  6:00   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ty51i6vf.fsf@isil.kanru.info \
    --to=kanru@kanru.info \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.