From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Existing redisplay profiling tool? Date: Sat, 14 Sep 2024 22:10:09 +0300 Message-ID: <86y13udpbi.fsf@gnu.org> References: <18DF89D6-9434-4F37-A14A-B9396A68A8F7@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27375"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 14 21:10:45 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1spYAP-0006yZ-A4 for ged-emacs-devel@m.gmane-mx.org; Sat, 14 Sep 2024 21:10:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spY9t-0006Mh-5F; Sat, 14 Sep 2024 15:10:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spY9r-0006Lc-Rh for emacs-devel@gnu.org; Sat, 14 Sep 2024 15:10:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spY9r-0001fC-IV; Sat, 14 Sep 2024 15:10:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=1vgFJ5FmqCAhDbJRnL+A8vo/M0d3BdAfE62u7PZrHa4=; b=aX99U9lIyhneWxGpyYsn aUdlIkVMP4KqIVCsmjBDhZaD0r3Pt1ytiLE9R6Xt9N01m2EjO6eriUMlkARLO9fiUCMSZEEpxITX7 nkrRF13tOaNY0rq+Rcp5dNhf7MmMz3Q6ACGlY0uCNA0ZfRfkRDGgeiSJi+GqBm9vjLctbkIULqNvQ A0jcKiIgAhzz/8yCIG4MVYlcUp1PxJ9QD0CvZ+KF3h5NKqlHM46nO97g5Rai8Hnu7lh669HNMccmY ntkZpm+kGayrk+w/mWnQteeaaug4uawFs9D/2Fml+i0OjCczpa8NIOZWEq0jxbqh/0DVqGb6InQRs fMzBBsFotAkj9A==; In-Reply-To: <18DF89D6-9434-4F37-A14A-B9396A68A8F7@gmail.com> (message from Yuan Fu on Sat, 14 Sep 2024 11:20:15 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323621 Archived-At: > From: Yuan Fu > 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.