emacs-devel
[Top][All Lists]
Advanced

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

Re: Existing redisplay profiling tool?


From: Eli Zaretskii
Subject: Re: Existing redisplay profiling tool?
Date: Sat, 14 Sep 2024 22:10:09 +0300

> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 14 Sep 2024 11:20:15 -0700
> 
> I’m doing some optimization for tree-sitter font-lock, and want to measure 
> the difference in a real editing session (rather than fontifying the whole 
> buffer 10 times). I’m sure there’s some tool for measuring time spent in 
> redisplay some where, but couldn’t find anything poking around.

How about using the scrolling benchmark through xdisp.c while
profiling?

(defun scroll-up-benchmark ()
  (interactive)
  (let ((oldgc gcs-done)
        (oldtime (float-time)))
    (condition-case nil (while t (scroll-up) (redisplay))
      (error (message "GCs: %d Elapsed time: %f seconds"
                      (- gcs-done oldgc) (- (float-time) oldtime))))))

Evaluate the above, then turn on profiling, then type
"M-x scroll-up-benchmark RET" with point at beginning
of buffer that visits xdisp.c under c-ts-mode.



reply via email to

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