From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#21028: Performance regression in revision af1a69f4d17a482c359d98c00ef86fac835b5fac (Apr 2014). Date: Mon, 13 Mar 2017 12:36:25 -0400 Message-ID: <1e7bc066-3f29-3897-5039-de7233efc58a@live.com> References: <559F9FAF.8090708@live.com> <83bmy5u6qo.fsf@gnu.org> <2fd3e21c-37b9-d559-6306-4e8adebad3d5@gmail.com> <831sz0sfug.fsf@gnu.org> <83oa095eaw.fsf@gnu.org> <83lgvd581m.fsf@gnu.org> <83a8br6hq0.fsf@gnu.org> <672a0c69-4352-735f-cba4-025e642626ea@gmail.com> <83vauf50wb.fsf@gnu.org> <7408d59c-92ba-b879-5ac1-3cd5eee9b4db@gmail.com> <83tw9z4zzp.fsf@gnu.org> <2cad0da9-c931-b547-07bb-efec2f2bcf1f@gmail.com> <83h95w0w3p.fsf@gnu.org> <27853273-e6d8-077e-b9e0-b2bec2fe1fae@gmail.com> <834m1v2630.fsf@gnu.org> <1c224dc1-bd71-a910-b7cf-00313e4aec40@live.com> <83efy2cx5n.fsf@gnu.org> <3c3e8384-3412-f5a5-3ab2-a7eb4e699f1c@live.com> <83d1dmcrnl.fsf@gnu.org> <39fe847e-ef8a-149f-4478-d02e7c794c9a@live.com> <837f3tch7y.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1489423044 10524 195.159.176.226 (13 Mar 2017 16:37:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Mar 2017 16:37:24 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 Cc: 21028@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 13 17:37:16 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnSy8-0001b6-2t for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Mar 2017 17:37:12 +0100 Original-Received: from localhost ([::1]:53203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnSyE-00081t-7e for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Mar 2017 12:37:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnSy2-00081a-J5 for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2017 12:37:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnSxx-0002nB-Vj for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2017 12:37:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55914) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cnSxx-0002my-RK for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2017 12:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cnSxx-0002Rt-Lh for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2017 12:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Mar 2017 16:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21028 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21028-submit@debbugs.gnu.org id=B21028.14894229969384 (code B ref 21028); Mon, 13 Mar 2017 16:37:01 +0000 Original-Received: (at 21028) by debbugs.gnu.org; 13 Mar 2017 16:36:36 +0000 Original-Received: from localhost ([127.0.0.1]:54113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnSxX-0002RI-R8 for submit@debbugs.gnu.org; Mon, 13 Mar 2017 12:36:36 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.73]:58377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnSxW-0002R1-5a for 21028@debbugs.gnu.org; Mon, 13 Mar 2017 12:36:35 -0400 Original-Received: from [18.26.2.123] ([18.26.2.123]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.184]) with ESMTPSA (Nemesis) id 0M3jhh-1bwjsY1UYL-00rLK9; Mon, 13 Mar 2017 17:36:27 +0100 In-Reply-To: <837f3tch7y.fsf@gnu.org> X-Provags-ID: V03:K0:H4MopMts8JSW6ltHGV+UGGERhBJkXb5abnpHSEEghRQWdV5iokj TRxQk4jyEplwGbTGOPFCyGXTHDHIK5zaViD7lpvB7aahgAM5SFXtgofDBEIlKdWRCMwOgOA 9sQgmuwuKuWq7Fj54+2jcJ9Lxdt9IYVNeMLhYa+ZVeW7IwGTL+ersXzAuz9BbFLLKa7iJuA Tzkkfg1XkDrc7EURWurrQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:HkaYT6KcIS4=:f671FOEIViUvFMjEU/ZozG Wypi/DNAgw6O8GfeOeO1U/noTcnqLp8F4dr56b0cZYOFEyVyM6MhGxXTYWGQSx83lv1tWWoXz RvRtcInZHiTk+79XiDb1pFkFJBzUiKasN6rmSUn++h0iv4Rrk/dtoRqwitQys9QpTHeUsWIPV 7KqvZp8Au01bPtfDs2c1fP2DRVu4SCqCtaQKnfb03P3S5rL6BBG6W8Ppjrvo60rTSaOTVbirt bvoxHjunIWbEhfdtS99Shjb6KtWUOKsFsq8mtLK/xg6FeCIl3hq5bcpPaG73hA1zjPJ7xtkPy AL6S0tAF8C4w75iO6rQlxJ/SbmxFADFemp2sGXEjI/ibxI8hRY8Eyv58RkahHgd+1lDnC/SZG qOMaGaLVeNuZtYhfCSrnQx9AutUSci0RQkSbHwHBsK1IqFYZxC71GzdFQPon/iA9tNyzcs0hh ZJm2FpOqXcu8UjW8PQZOMlI/FCl7Y9l3mnhySQJLS2qsrLdqeZVBQEZ3pEolUecHXen73hm/w UCHGI7JRCdMulohCgoYtXN2GDAlmGpRs6C2EV+BZ57u9sdnOa2NrMcX1w+zFDe/3mFzIBgT7g ElXWi2PlrtEQ6XtFYzgNGa01ueGbXNxR53eCOQpu/KqWuo+C68aXBbzC2C/qHbMy9NC+fl/gc eOT8+Yyd0VfvVKWcxIQw1e8rXdZZnWohH5AtByv00ojaSRUA5fCDWSNJVlcxJ0dCCekaRW5Tc hf+7So2Iw6X1i9gN X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130544 Archived-At: 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 > 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. > . Why is your 1.5 sec timing deemed "unusably slow" vs 0.35 sec > which is the normal speed? Because my repro wasn't very good, apparently :) As you see above, your tests takes 1 minute without your patch, and 1 second with it. > 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. Some redisplays cycles takes as much as a few seconds. That's enough to make it impossible to use Emacs. In this concrete example, pressing the up arow introduces a half-second lag. Pressing M-x doesn't show anything for close to .5 seconds. Keeping the down arrow pressed for 1 second stops redisplay until I release the key, and then Emacs stays frozen for tens of seconds before redisplaying anything. > Are you sure the above program exhibits your > real-life problem? Is it possible we are chasing the wrong geese > here? I this it does exhibit my problem, as we saw above. > . 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)? Because you asked me for a minimal repro for my bug :) 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. 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. > . 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 In both, system-configuration-options is "" system-configuration-features is "XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11" in 25.1 (slow), and "XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 LIBSYSTEMD" in master with your patch (fast). > 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'm not alone. At least one other person posted to this bug list (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21028#74) and confirmed that the patch fixed their problem. The problem gets regularly mentioned elsewhere (when I opened this bug I linked to https://github.com/purcell/emacs.d/issues/273 "when I first try to input some chinese characters, it's very slow to moving [...] especially use C-n, C-p, emacs will hang for about 1~2 seconds."; a more recent example is at https://sympa.inria.fr/sympa/arc/coq-club/2017-03/msg00050.html "Appending to the 'unicode list makes emacs unbearably slow."). Additionally, as the maintainer of company-coq, I've had multiple people tell me that it was just too slow to use, only to realize that turning off prettify-symbols-mode was enough to make e verything snappy again for them. Clément.