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 19:22:45 +0200

> Cc: 21028@debbugs.gnu.org
> From: Clément Pit--Claudel <clement.pitclaudel@live.com>
> Date: Mon, 13 Mar 2017 12:36:25 -0400
> 
> On 2017-03-13 11:46, Eli Zaretskii wrote:
> > 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).
> 
> Thanks, that's a much better repro than mine :) Here are my timings:
> 
> # Stock 24.5
> 12:01:26 /build/emacs
> $ 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 (_ 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  1m1.862s
> user  0m18.644s
> sys   0m15.972s
> 
> # Stock 25.1
> $ time 25.1/src/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  1m4.705s
> user  0m18.296s
> sys   0m18.444s
> 
> # Master with your patch
> $ time master/src/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  0m1.207s
> user  0m0.928s
> sys   0m0.028s

I see nothing of the kind, as you saw.  With the same fonts as you
use.  So it's definitely not a problem with the fonts.  Which is
strange, since the profiles you provided seem to indicate a
font-related problem.

> > 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:
> 
> I get similar timings.

So why not use Symbola (i.e. the default fontset setup)?

>In real life, I have more than 6 fonts, all covering different subsets (I 
>linked to my own config in a previous post in this thread).  I don't know 
>exactly what Ubuntu Mono covers, and in fact that changes from time to time, 
>so I just want it to display everything it can (hence the first invocation 
>with 'unicode). Then I want to use Segoe UI for emoji, so I use a range for 
>that.  And then I then want Symbola to be used for any symbol that it covers 
>that are not covered by the previous two fonts — hence the second call with 
>'unicode.  I then have a few fonts for various CJK ranges, but even there I 
>don't know what exact range each font covers.

Symbola supports emoji in the default fontset, so neither Segoe UI
nort Symbola should be needed in your setup.  As for Ubuntu Mono,
isn't that the default monospaced font?

In short, are you sure you really need those customizations?  You may
be creating your own problems.

> But I guess it boils down to: "⇒" is not the only symbol I use, and I don't 
> want to encode all ranges supported by Symbola explicitly in my emacs config 
> (nor, of course, all the CJK ranges supported by the barious fonts I use for 
> east-asian scripts).  As I noted previously, remember that the original bug 
> report didn't even use symbols (I ran into this when trying to edit text 
> written in Chinese in Emacs.

The default fontset should already provide you with the fonts that
display all of these, including CJK.  If you use the default, what
characters aren't displayed well enough, or at all?

Is this the complete fontset setup you are using:

  (let ((cjk-font "WenQuanYi Micro Hei Mono")
        (fontset t)) ; "fontset-default"
    (set-fontset-font t (cons ?≔ ?≔) "FreeSerif" nil 'prepend)
    (set-fontset-font fontset 'unicode (font-spec :name "Consolas") nil 'append)
    (set-fontset-font fontset 'unicode (font-spec :name "Symbola") nil 'append)
    (set-fontset-font fontset '(#x4E00 . #x9FFF) (font-spec :name cjk-font))
    (set-fontset-font fontset '(#x3400 . #x4DFF) (font-spec :name cjk-font))
    (set-fontset-font fontset '(#x20000 . #x2A6DF) (font-spec :name cjk-font))
    (set-fontset-font fontset '(#xF900 . #xFAFF) (font-spec :name cjk-font))
    (set-fontset-font fontset '(#x2F800 . #x2FA1F) (font-spec :name cjk-font)))

If it is, I will try to reproduce using this fontset.





reply via email to

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