From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gennady Uraltsev Newsgroups: gmane.emacs.bugs Subject: bug#26402: 25.2; Font rendering extremely slow on any non-default font Date: Sun, 9 Apr 2017 00:33:23 +0200 Message-ID: <2a3d3577-ccbf-c30f-15ab-390cd1cd5278@gmail.com> References: <588df69e-068d-e2c5-3c2f-3ca238313aa9@gmail.com> <83inmfm00v.fsf@gnu.org> <04e03d3a-62f1-82f2-b7a8-9e36cf5e826b@gmail.com> <83h91ynam6.fsf@gnu.org> <541302bf-540b-aedb-4ca4-2ba3acfe495e@gmail.com> <83bms6n7hk.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Emrv2X49DHqerpPeAdTduwkP7PwmfaLCa" X-Trace: blaine.gmane.org 1491690861 25644 195.159.176.226 (8 Apr 2017 22:34:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Apr 2017 22:34:21 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cc: 26402@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 09 00:34:13 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 1cwyvp-0005LX-32 for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Apr 2017 00:34:09 +0200 Original-Received: from localhost ([::1]:56635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwyvu-0003So-PG for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Apr 2017 18:34:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwyvm-0003SU-QV for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 18:34:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwyvi-0000uc-Ob for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 18:34:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40362) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cwyvi-0000uW-Lk for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 18:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cwyvi-0007Zh-84 for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 18:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gennady Uraltsev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Apr 2017 22:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26402 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26402-submit@debbugs.gnu.org id=B26402.149169082829096 (code B ref 26402); Sat, 08 Apr 2017 22:34:02 +0000 Original-Received: (at 26402) by debbugs.gnu.org; 8 Apr 2017 22:33:48 +0000 Original-Received: from localhost ([127.0.0.1]:38560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwyvT-0007ZD-Qa for submit@debbugs.gnu.org; Sat, 08 Apr 2017 18:33:48 -0400 Original-Received: from mail-wr0-f170.google.com ([209.85.128.170]:32774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwyvS-0007Yz-79 for 26402@debbugs.gnu.org; Sat, 08 Apr 2017 18:33:46 -0400 Original-Received: by mail-wr0-f170.google.com with SMTP id g19so84104520wrb.0 for <26402@debbugs.gnu.org>; Sat, 08 Apr 2017 15:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=8kA6bYI78DLkp1/VOfWuX6Jf6KavDkkWA01ofzbZm6c=; b=RMMP86Zz2MzaCxmvQodVdNK3es6gTB4dFQ94GR30DkSBW2Yuz1yAv9bSGaM2kWNwkA i4ODzepdj8UAKcM+VX6N/uktF8NzKBxuoBC1pd718BunpxBjmoFzdlP1KxMLHUVnvqki rNNfMYp5vnuLtByCZAPn7KwTN+dFXAIlE8JDp2TvLiqqTKCZLOBWGSwkYJfWod/K6422 C1LrCcOR9n6Q6oIHfLH2uASlMuhu2Kr5KLj3UtIiEEROPgKkYghdtMW3RT1almZaj3sR 2zTf4FEr/UNGVdgakEER3RvXaxsrOoecSoA2NaiBHdN+LcUUOcYzYapG1b7Fex1U+ink y55w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=8kA6bYI78DLkp1/VOfWuX6Jf6KavDkkWA01ofzbZm6c=; b=Z3VnWqrqda3CVCGSlZG/w/U0AV2HwbLVK1LHyqyGINwmkUqn7sOXlFjFUq56gmHB1F x+6unGFR/3lbm9X2L8xmX7H+Md7rUhWYluFb8We2T2yN7PXVyvM7hQujd/3/qCmXC/zi U5awAUkvZQlrfeNnFXR6+iMtCBfqydu4I3YquJGiNPxVvjnnR11S4UedvL7oymhBKIhG PtqsN+NCuqKMCaFcRgmVj7Xxl5LpGiVZQyPz5QLwcN6ua64/4HdvQvXEWkwx8atVED1h njbKwBwpU2P8qUpEjKnVZHSUmzWf2S+jVYQQu/DmkEIeL5CSakdkjwW+kfy44rlGZUtY 4pdw== X-Gm-Message-State: AFeK/H0v1N93C54yIPqewrFTsNTUBWRlt0U2h3R1VbnKlXmzE8QdYOxsDVlAjVCtgvg+oQ== X-Received: by 10.223.128.99 with SMTP id 90mr42065050wrk.101.1491690820115; Sat, 08 Apr 2017 15:33:40 -0700 (PDT) Original-Received: from halen.uraltsev (dslb-092-078-093-177.092.078.pools.vodafone-ip.de. [92.78.93.177]) by smtp.gmail.com with ESMTPSA id m14sm11389804wrb.13.2017.04.08.15.33.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Apr 2017 15:33:39 -0700 (PDT) In-Reply-To: <83bms6n7hk.fsf@gnu.org> 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:131389 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Emrv2X49DHqerpPeAdTduwkP7PwmfaLCa Content-Type: multipart/mixed; boundary="LGsJnoqJdKSfurDWpPnWe0k12wO9JWRqU"; protected-headers="v1" From: Gennady Uraltsev To: Eli Zaretskii Cc: 26402@debbugs.gnu.org Message-ID: <2a3d3577-ccbf-c30f-15ab-390cd1cd5278@gmail.com> Subject: Re: bug#26402: 25.2; Font rendering extremely slow on any non-default font References: <588df69e-068d-e2c5-3c2f-3ca238313aa9@gmail.com> <83inmfm00v.fsf@gnu.org> <04e03d3a-62f1-82f2-b7a8-9e36cf5e826b@gmail.com> <83h91ynam6.fsf@gnu.org> <541302bf-540b-aedb-4ca4-2ba3acfe495e@gmail.com> <83bms6n7hk.fsf@gnu.org> In-Reply-To: <83bms6n7hk.fsf@gnu.org> --LGsJnoqJdKSfurDWpPnWe0k12wO9JWRqU Content-Type: multipart/mixed; boundary="------------60F1FDAA39A81D657769717A" This is a multi-part message in MIME format. --------------60F1FDAA39A81D657769717A Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable [Sorry about the CC, must have escaped me] I recompiled from latest git of today so emacs decalres version 26.0.50 I tried recompiling without your patch and also with your patch. No apparent improvement I tried running both (text-scale-adjust INC) and buffer-set-face both with and without (setq inhibit-compacting-font-caches t) The profiler profiles are attached. The profiler output for moving the cursor down from the beginning of the file to the end are as follows: ***************** M-x buffer-set-face variable-width without (setq inhibit-compacting-font-caches t) ***************** > - command-execute 2227 = 99% > - call-interactively 2227 = 99% > - funcall-interactively 2189 = 98% > - next-line 2176 = 97% > - line-move 2176 = 97% > - line-move-partial 1560 = 69% > - default-line-height 808 = 36% > default-font-height 808 = 36% > - window-screen-lines 752 = 33% > - default-line-height 752 = 33% > default-font-height 752 = 33% > - default-line-height 616 = 27% > default-font-height 612 = 27% > - display-graphic-p 4 = 0% > framep-on-display 4 = 0% > - execute-extended-command 13 = 0% > - sit-for 13 = 0% > redisplay 8 = 0% > - byte-code 34 = 1% > - read-extended-command 34 = 1% > - completing-read 34 = 1% > - completing-read-default 34 = 1% > - read-from-minibuffer 17 = 0% > - window--sanitize-window-sizes 5 = 0% > - walk-window-tree 5 = 0% > - walk-window-tree-1 5 = 0% > - # 5 = 0% > window-min-size 5 = 0% > - ... 4 = 0% > Automatic GC 4 = 0% ***************** M-x buffer-set-face variable-width with (setq inhibit-compacting-font-caches t) ***************** > - command-execute 2509 = 99% > - call-interactively 2509 = 99% > - funcall-interactively 2459 = 97% > - next-line 2415 = 96% > - line-move 2415 = 96% > - line-move-partial 1763 = 70% > - default-line-height 887 = 35% > default-font-height 887 = 35% > - window-screen-lines 876 = 34% > - default-line-height 876 = 34% > default-font-height 876 = 34% > - default-line-height 652 = 25% > default-font-height 652 = 25% > - execute-extended-command 44 = 1% > - sit-for 23 = 0% > - redisplay 12 = 0% > - redisplay_internal (C function) 4 = 0% > kill-this-buffer-enabled-p 4 = 0% > - command-execute 21 = 0% > - call-interactively 21 = 0% > - funcall-interactively 21 = 0% > - profiler-report 21 = 0% > - profiler-report-cpu 21 = 0% > profiler-cpu-profile 21 = 0% > - byte-code 50 = 1% > - read-extended-command 50 = 1% > - completing-read 50 = 1% > - completing-read-default 50 = 1% > - read-from-minibuffer 21 = 0% > - command-execute 3 = 0% > - call-interactively 3 = 0% > - funcall-interactively 3 = 0% > delete-backward-char 3 = 0% > - ... 5 = 0% > Automatic GC 5 = 0% On 08/04/17 19:18, Eli Zaretskii wrote: > [Please keep the bug address on the CC list.] >=20 >> From: Gennady Uraltsev >> Date: Sat, 8 Apr 2017 18:32:34 +0200 >> >> The default font that emacs -Q starts with is >> >> xft:-adobe-Source Code >> Pro-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1 (#x2C) >> >> (I guess it comes from the fact that that is my predefined qt and gtk >> monospace font) >> >> once zooming in (text-scale-adjust INC) I get >> >> xft:-adobe-Source Code >> Pro-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1 (#x1E) >> >> If instead of zooming in I do M-x buffer-face-set variable-pitch >> I get the font >> >> xft:-unknown-Roboto-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1 (= #x48) >> >> >> >> I can also replicate this by setting the global font to be something >> else like >> >> xft:-unknown-Droid Sans-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1= >> (#x54) >> xft:-monotype-Noto Sans-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1= >> (#x36) >> >> at the level of the frame by using >> >> M-x set-frame-font >> -unknown-Droid Sans-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1 >> or >> -monotype-Noto Sans-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1 >> >> respectively. This does not have a negative impact on performance. But= >> as soon as I enable something like >> >> M-x buffer-face-set fixed-pitch or >> (text-scale-adjust INC) the problem returns >=20 > Can you build your own Emacs? If so, could you please apply the > following patch and see if it solves the problem? >=20 > diff --git a/src/font.c b/src/font.c > index a929509..bb6d18b 100644 > --- a/src/font.c > +++ b/src/font.c > @@ -2777,21 +2777,22 @@ font_list_entities (struct frame *f, Lisp_Objec= t spec) > val =3D XCDR (val); > else > { > - val =3D driver_list->driver->list (f, scratch_font_spec); > - if (!NILP (val)) > - { > - Lisp_Object copy =3D copy_font_spec (scratch_font_spec); > + Lisp_Object copy; > =20 > - val =3D Fvconcat (1, &val); > - ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); > - XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); > - } > + val =3D driver_list->driver->list (f, scratch_font_spec); > + if (NILP (val)) > + val =3D zero_vector; > + else > + val =3D Fvconcat (1, &val); > + copy =3D copy_font_spec (scratch_font_spec); > + ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); > + XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); > } > - if (VECTORP (val) && ASIZE (val) > 0 > + if (ASIZE (val) > 0 > && (need_filtering > || ! NILP (Vface_ignored_fonts))) > val =3D font_delete_unmatched (val, need_filtering ? spec : Qnil, s= ize); > - if (VECTORP (val) && ASIZE (val) > 0) > + if (ASIZE (val) > 0) > list =3D Fcons (val, list); > } > =20 >=20 --------------60F1FDAA39A81D657769717A Content-Type: text/plain; charset=UTF-8; name="BAD-patched-buffer-set-face-profile" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="BAD-patched-buffer-set-face-profile" [profiler-profile "24.3" cpu #s(hash-table size 65 test equal rehash-size= 1.5 rehash-threshold 0.8125 data ([redisplay sit-for execute-extended-co= mmand funcall-interactively call-interactively command-execute nil nil ni= l nil nil nil nil nil nil nil] 8 [sit-for execute-extended-command funcal= l-interactively call-interactively command-execute nil nil nil nil nil ni= l nil nil nil nil nil] 5 [default-font-height default-line-height line-mo= ve-partial line-move next-line funcall-interactively call-interactively c= ommand-execute nil nil nil nil nil nil nil nil] 808 [default-font-height = default-line-height window-screen-lines line-move-partial line-move next-= line funcall-interactively call-interactively command-execute nil nil nil= nil nil nil nil] 752 [default-font-height default-line-height line-move = next-line funcall-interactively call-interactively command-execute nil ni= l nil nil nil nil nil nil nil] 612 [call-interactively command-execute ni= l nil nil nil nil nil nil nil nil nil nil nil nil nil] 4 [framep-on-displ= ay display-graphic-p default-line-height line-move next-line funcall-inte= ractively call-interactively command-execute nil nil nil nil nil nil nil = nil] 4 [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] = 5 [completing-read-default completing-read read-extended-command byte-cod= e call-interactively command-execute nil nil nil nil nil nil nil nil nil = nil] 17 [read-from-minibuffer completing-read-default completing-read rea= d-extended-command byte-code call-interactively command-execute nil nil n= il nil nil nil nil nil nil] 12 [window-min-size "#" wa= lk-window-tree-1 walk-window-tree window--sanitize-window-sizes read-from= -minibuffer completing-read-default completing-read read-extended-command= byte-code call-interactively command-execute nil nil nil nil] 5 [Automat= ic\ GC] 4)) (22761 25294 926762 984000) nil] --------------60F1FDAA39A81D657769717A Content-Type: text/plain; charset=UTF-8; name="BAD-patched-inhibit-cache-buffer-set-face-profile" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="BAD-patched-inhibit-cache-buffer-set-face-profile" [profiler-profile "24.3" cpu #s(hash-table size 65 test equal rehash-size= 1.5 rehash-threshold 0.8125 data ([kill-this-buffer-enabled-p redisplay_= internal\ \(C\ function\) redisplay sit-for execute-extended-command func= all-interactively call-interactively command-execute nil nil nil nil nil = nil nil nil] 4 [redisplay sit-for execute-extended-command funcall-intera= ctively call-interactively command-execute nil nil nil nil nil nil nil ni= l nil nil] 8 [sit-for execute-extended-command funcall-interactively call= -interactively command-execute nil nil nil nil nil nil nil nil nil nil ni= l] 11 [default-font-height default-line-height line-move-partial line-mov= e next-line funcall-interactively call-interactively command-execute nil = nil nil nil nil nil nil nil] 887 [default-font-height default-line-height= window-screen-lines line-move-partial line-move next-line funcall-intera= ctively call-interactively command-execute nil nil nil nil nil nil nil] 8= 76 [default-font-height default-line-height line-move next-line funcall-i= nteractively call-interactively command-execute nil nil nil nil nil nil n= il nil nil] 652 [nil nil nil nil nil nil nil nil nil nil nil nil nil nil = nil nil] 7 [read-from-minibuffer completing-read-default completing-read = read-extended-command byte-code call-interactively command-execute nil ni= l nil nil nil nil nil nil nil] 18 [completing-read-default completing-rea= d read-extended-command byte-code call-interactively command-execute nil = nil nil nil nil nil nil nil nil nil] 29 [delete-backward-char funcall-int= eractively call-interactively command-execute read-from-minibuffer comple= ting-read-default completing-read read-extended-command byte-code call-in= teractively command-execute nil nil nil nil nil] 3 [profiler-cpu-profile = profiler-report-cpu profiler-report funcall-interactively call-interactiv= ely command-execute execute-extended-command funcall-interactively call-i= nteractively command-execute nil nil nil nil nil nil] 21 [Automatic\ GC] = 5)) (22761 25503 836230 71000) nil] --------------60F1FDAA39A81D657769717A-- --LGsJnoqJdKSfurDWpPnWe0k12wO9JWRqU-- --Emrv2X49DHqerpPeAdTduwkP7PwmfaLCa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJQQMgTpmrxMi2uL37hfeU97djTEFAljpZTMACgkQ7hfeU97d jTHhDA/+Kp85jwPhXVaIbLp/SWn4ALs5971hFYvpwosh/d+MjxO7hEOANhj+z2l7 ASyVgRSm/DhIaym9gnTcU5SD9x0KFEUEwiopi3iFL/7UDg804lL695OtRZRchCQi cvKYPKkDpkheXX6KOUhNS1sfbgXmsQDqeRF7GKoA2VFIMcI5uvVKtq+8ZygH67gb THn0+9jMpFKYpA8fCzNWwONyXOTV168Ym9+WtJJYqAlmX//Es0Gp5GuZsDvJMb54 3OOumA3RvmPuz0gCccjREy79WbpzRVH6gVPC0NyQW+iI70od1YaKMGqArpKzim6s 0fJnyQ9Dj+jB/rwAx8uqWTKCWBEDwFqyEGAE8TjUYnWIvXzNohA60mYsgRqHJ+xH UDAQwDdH1dEZD1lSBplcu/bzS/McgIyAX1i1MitwhfwY/0X1rqE2mcqRWXTM9YNc 0kcD4ocPo4JAwGzbl5SH1WS/BHln7oYmD72f+T11MgBJQ7lA3dP8hCFc+tIZyJK+ 2jsiPpGCvo6ECqKIVtY9gXhETNjDykfMkdyJx68p5BUF5v8O7X+l/QIg6xeAE5jE XyWtikuNbNsc4hIY6o0Z0lZLLO6nKED2trfujQ6zL1q41R7mSPL/ghHijkNPl3/M X8DhCKxmLqf2zIDTYVwJGPkq1p4bwFxyIPBjS93KT+XtI4zX110= =qNuL -----END PGP SIGNATURE----- --Emrv2X49DHqerpPeAdTduwkP7PwmfaLCa--