emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 0/7] Cleanups and tests for DEFVAR_PER_BUFFER variables


From: Spencer Baugh
Subject: Re: [PATCH 0/7] Cleanups and tests for DEFVAR_PER_BUFFER variables
Date: Sat, 03 Apr 2021 16:53:42 -0400

Eli Zaretskii <eliz@gnu.org> 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 |



reply via email to

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