From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 0/7] Cleanups and tests for DEFVAR_PER_BUFFER variables Date: Sat, 03 Apr 2021 16:53:42 -0400 Message-ID: <87r1jrw0mh.fsf@catern.com> References: <87a6qhyish.fsf@catern.com> <83sg49g7n6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34186"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 03 22:54:19 2021 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 1lSnHf-0008np-KD for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Apr 2021 22:54:19 +0200 Original-Received: from localhost ([::1]:55898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSnHe-0000Cu-Mr for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Apr 2021 16:54:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSnH8-0008ED-Pt for emacs-devel@gnu.org; Sat, 03 Apr 2021 16:53:46 -0400 Original-Received: from venus.catern.com ([68.183.49.163]:40996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSnH7-00006f-7R; Sat, 03 Apr 2021 16:53:46 -0400 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=98.7.229.235; helo=localhost; envelope-from=sbaugh@catern.com; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=catern.com; s=mail; t=1617483223; bh=Fauweu+0/uV4xMLfvdC1hPR32aSvC23lypOio96oSwc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=J+3l9tMcA6AAkLVQn+nyc4NdcNOhs778yOonwpyjwbXascT7Lf3kRXQLq8Rg7ZXea vNp3WNS8TwVNixFWbAtleNrgJT0ROA6a1tIsf6rrm9z1vW9FY9MgazVjTWYNoyqc56 tTwmzTXwR08a/xHMf4sWwjnaYyEqxEeyVgEvxqwA= Original-Received: from localhost (cpe-98-7-229-235.nyc.res.rr.com [98.7.229.235]) by venus.catern.com (Postfix) with ESMTPSA id 41EF32E6F44; Sat, 3 Apr 2021 20:53:43 +0000 (UTC) In-Reply-To: <83sg49g7n6.fsf@gnu.org> Received-SPF: pass client-ip=68.183.49.163; envelope-from=sbaugh@catern.com; helo=venus.catern.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:267366 Archived-At: Eli Zaretskii writes: > Thanks, that's encouraging. But we need a few more benchmarks, I > think. One of them should be for redisplay, as it's a > performance-critical part of Emacs, and it accesses buffer-local > variables quite a lot. So something like a benchmark of scrolling > through xdisp.c one line at a time in an interactive session would > probably give us an idea. OK, I did that. Specifically I ran: (defun xdisp-bench () (let ((gc-cons-threshold 8000000000)) (print (number-to-string (car (benchmark-run 3 (with-temp-buffer (switch-to-buffer (current-buffer)) (let* ((height (window-total-height)) (lines (+ 10 height))) (dotimes (i (* 2 height)) (insert "\nhello" (number-to-string i))) (dotimes (_ 5) (dotimes (_ lines) (scroll-down 1) (redisplay)) (dotimes (_ lines) (scroll-up 1) (redisplay)))))) )) #'external-debugging-output) (kill-emacs))) My results (from running emacs -f xdisp-bench 10 times and discarding the first 2 results, on X11 with GTK): | Unmodified Emacs | 6.529 | | My changes | 6.610 | | My changes + no default for bidi_display_reordering | 6.582 | About a 1-2% slowdown from my changes. I tried removing the default for bidi_display_reordering; customizing bidi-display-reording is explicitly unsupported anyway, so I think changing its behavior is reasonable. That improved performance but unfortunately not enough to fully match an unmodified Emacs. Not sure what else to do. I could remove the defaults for more variables that are heavily used in xdisp.c, but I guess that will be fairly difficult for most of them. Thoughts? > Another benchmark we frequently use is to remove all *.elc files and > then time "make" which byte-compiles them all. I did this, seems fine: | Unmodified Emacs | 38m2.042s | | With my changes | 37m48.127s |