all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Existing redisplay profiling tool?
Date: Sat, 14 Sep 2024 22:10:09 +0300	[thread overview]
Message-ID: <86y13udpbi.fsf@gnu.org> (raw)
In-Reply-To: <18DF89D6-9434-4F37-A14A-B9396A68A8F7@gmail.com> (message from Yuan Fu on Sat, 14 Sep 2024 11:20:15 -0700)

> 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	other threads:[~2024-09-14 19:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-14 18:20 Existing redisplay profiling tool? Yuan Fu
2024-09-14 19:10 ` Eli Zaretskii [this message]
2024-09-16  6:16   ` Yuan Fu
2024-09-16 12:19     ` Eli Zaretskii
2024-09-17  2:49       ` Yuan Fu
2024-09-17 12:38         ` 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=86y13udpbi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=casouri@gmail.com \
    --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.