emacs-devel
[Top][All Lists]
Advanced

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

Re: CC Mode with font-lock-maximum-decoration 2 [Was Major modes using `


From: Gregory Heytings
Subject: Re: CC Mode with font-lock-maximum-decoration 2 [Was Major modes using `widen' is a good, even essential, programming practice.]
Date: Mon, 08 Aug 2022 15:51:50 +0000



I've just measured the font-locking time, and (let's call it) CC Mode/2 fontifies at 72% the speed of Emacs Lisp Mode.


I don't know under which exact conditions you obtained these (very favorable) numbers, but I at least cannot reproduce them. Here are two ways to measure the relative speed of fontification in Emacs Lisp and C. First create a "complex.el" file with

for i in $(seq 1 3); do cat lisp/simple.el; done > complex.el

(Note that the resulting complex.el file is slightly larger than xdisp.c.)

Then:

1. Use your (benchmark-run 1 (time-scroll)) after loading complex.el and xdisp.c in emacs -Q. The numbers here are 4.5 seconds for complex.el and 20.5 seconds for xdisp.c. More than four times slower.

2. Use (benchmark-run 1 (font-lock-fontify-region (point-min) (point-max)) after loading complex.el and xdisp.c in emacs -Q. The numbers here are 1.2 seconds for complex.el and 12.5 seconds for xdisp.el. More than ten times slower.



reply via email to

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