bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#21028: Performance regression in revision af1a69f4d17a482c359d98c00e


From: Eli Zaretskii
Subject: bug#21028: Performance regression in revision af1a69f4d17a482c359d98c00ef86fac835b5fac (Apr 2014).
Date: Mon, 13 Mar 2017 17:46:25 +0200

> Cc: 21028@debbugs.gnu.org
> From: Clément Pit--Claudel <clement.pitclaudel@live.com>
> Date: Sun, 12 Mar 2017 15:19:48 -0400
> 
> > So you are saying that this:
> > 
> >   $ time src/emacs -Q --eval "(progn (set-fontset-font \"fontset-startup\" 
> > 'unicode \"Ubuntu Mono\" nil) (set-fontset-font \"fontset-startup\" 
> > 'unicode \"Symbola\" nil 'append) (dotimes (_ 500) (insert (make-string 20 
> > 8658) \"\n\") (run-with-idle-timer 0 nil #'kill-emacs)))"
> > 
> > takes about 1.5 sec on your system, is that right?  (Note that I
> > replaced XITS Math with Symbola here.)
> 
> Correct.  Here are extra timings:
> [...]
> # With Noto Sans: slow
> $ time 24.5/src/emacs -Q --eval "(progn (set-fontset-font \"fontset-startup\" 
> 'unicode \"Noto Sans\" nil) (set-fontset-font \"fontset-startup\" 'unicode 
> \"Symbola\" nil 'append) (dotimes (_ 500) (insert (make-string 20 8658) 
> \"\n\") (run-with-idle-timer 0 nil #'kill-emacs)))"
> 
> real    0m1.593s
> user    0m0.504s
> sys     0m0.236s
> 
> # With Fira Sans: slow
> $ time 24.5/src/emacs -Q --eval "(progn (set-fontset-font \"fontset-startup\" 
> 'unicode \"Fira Sans\" nil) (set-fontset-font \"fontset-startup\" 'unicode 
> \"Symbola\" nil 'append) (dotimes (_ 500) (insert (make-string 20 8658) 
> \"\n\") (run-with-idle-timer 0 nil #'kill-emacs)))"
> 
> real    0m1.511s
> user    0m0.520s
> sys     0m0.248s

I installed Fira Sans and Noto Sans, and changed your program to insert
more of these characters and actually display all the characters it
inserts (see below).  I see timings like the one below:

  time emacs -Q --eval "(progn (set-fontset-font \"fontset-startup\" 'unicode 
\"Noto Sans\" nil) (set-fontset-font \"fontset-startup\" 'unicode \"Symbola\" 
nil 'append) (dotimes (_ 5000) (insert (make-string 20 8658) \"\n\")) 
(goto-char (point-min)) (sit-for 0) (condition-case nil (while t (scroll-up) 
(sit-for 0)) (error nil)) (run-with-idle-timer 0 nil #'kill-emacs)))"

  real    00h00m06.069s
  user    00h00m05.272s
  sys     00h00m00.702s

If I don't specify the "normal" font in the fontset, only Symbola, or
if I don't specify fonts at all (Symbola is used by default for the
character in question), then I get timings like the one below:

  time emacs -Q --eval "(progn (dotimes (_ 5000) (insert (make-string 20 8658) 
\"\n\")) (goto-char (point-min)) (sit-for 0) (condition-case nil (while t 
(scroll-up) (sit-for 0)) (error nil)) (run-with-idle-timer 0 nil 
#'kill-emacs)))"

  real    00h00m02.039s
  user    00h00m01.606s
  sys     00h00m00.358s

The above timings are with an optimized build of the stock Emacs 25.2
RC2 codebase.

So now I have the following questions:

  . Why is your 1.5 sec timing deemed "unusably slow" vs 0.35 sec
    which is the normal speed?  My timings above seem to produce a
    similar 4-fold slowdown, but if I use the same session (with
    hundreds of U+21D2 symbols) interactively, the display is quite
    responsive, and 6 sec for scrolling 5000 lines doesn't sound
    "unusable" to me.  Are you sure the above program exhibits your
    real-life problem?  Is it possible we are chasing the wrong geese
    here?

  . Why are you setting up your fontset with 2 fonts and claim that
    both support the entire Unicode range (as opposed to adding to the
    fontset just one font for specific ranges of codepoints not
    covered well by the default font)?  What happens if you do this
    instead:

      time emacs -Q --eval "(progn (set-fontset-font \"fontset-startup\" 
'(#x21D0 . #x21DF) \"Symbola\" nil 'prepend) (dotimes (_ 5000) (insert 
(make-string 20 8658) \"\n\")) (goto-char (point-min)) (sit-for 0) 
(condition-case nil (while t (scroll-up) (sit-for 0)) (error nil)) 
(run-with-idle-timer 0 nil #'kill-emacs)))"

    I get the "fast" timing for this test, and AFAIU it should produce
    the exact same display as for the "slow" timing.  Why can't
    something like this be used in your real-life use cases?

  . Finally, what are the values of the following variables in your
    Emacs used for timings?  (I don't see them anywhere in this bug's
    discussions, apologies if I missed something.)

      system-configuration-options
      system-configuration-features

Bottom line: it is strange that you alone see these problems, and no
one else AFAIR complained about unusably slow prettify-symbols-mode
display.  I'd like to understand what is special about your setup
before we make any code changes based on your single use case.

Thanks.





reply via email to

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