emacs-devel
[Top][All Lists]
Advanced

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

Re: cc-mode fontification feels random


From: Daniel Colascione
Subject: Re: cc-mode fontification feels random
Date: Fri, 11 Jun 2021 11:28:18 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 6/11/21 11:22 AM, Eli Zaretskii wrote:

Cc: rudalics@gmx.at, monnier@iro.umontreal.ca, rms@gnu.org,
  emacs-devel@gnu.org
From: Daniel Colascione <dancol@dancol.org>
Date: Fri, 11 Jun 2021 11:02:34 -0700

     0.026s, 0.025s, 0.026s, 0.078s, 0.026s, 0.027s.

That is, with the exception of the fourth timing, the scroll operation
takes a little over 1/40 second.

This is in an Emacs-28 compiled with default optimisation, on a 4
year-old first generation Ryzen machine.

For me personally, this scrolling speed, in conjunction with
fast-but-imprecise-scrolling, is acceptable.  I also accept there are
people with slower machines.
I suggest to compare these times with Emacs 23 to see how we
regressed.
Regression is acceptable in exchange for correctness so long as absolute
performance is adequate. We're not using 80486s anymore.
Here are my times using an optimized build of Emacs 27.2 on a 3.4GHz
Core i7 box:

   0.015625
   0.03125
   0.015625
   0.046875
   0.09375
   0.0625
   0.015625
   0.03125
   0.015625
   0.03125
   0.015625
   0.03125

You consider this to be adequate performance for a single
window-scroll?  (I don't have an optimized build of Emacs 28, but
there's no reason to believe it is faster; quite the opposite.)

native-comp?


And here's the top part of the profile while running the above
benchmark:

   - redisplay_internal (C function)                                 159  65%
    - jit-lock-function                                              158  65%
     - jit-lock-fontify-now                                          158  65%
      - jit-lock--run-functions                                      158  65%
       - run-hook-wrapped                                            158  65%
        - #<compiled -0x1ffffffff8a67860>                            158  65%
        - font-lock-fontify-region                                  157  65%
         - c-font-lock-fontify-region                               157  65%
          - font-lock-default-fontify-region                        146  60%
           - font-lock-fontify-keywords-region                      143  59%
            - c-font-lock-declarations                               97  40%
             - c-find-decl-spots                                     97  40%
              - #<compiled -0x1ffffffff94b65d0>                      73  30%
               - c-forward-decl-or-cast-1                            38  15%
                - c-forward-type                                     22   9%
                 - c-check-qualified-type                             7   2%

We can stick our heads in the sand as much as we want, but facts are
stubborn things.

Hrm. That doesn't seem consistent with Alan's report that we spend a ton of time doing work like deciding whether a brace occurs at top-level. My question stands: what core facilities can we add to accelerate cc-mode's parsing here? There's got to be some efficiency we can gain here.




reply via email to

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