all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27350: 25.2; Make `inhibit-compacting-font-caches' customizable
@ 2017-06-13 14:33 Drew Adams
  2017-06-13 15:02 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Drew Adams @ 2017-06-13 14:33 UTC (permalink / raw)
  To: 27350

Subject line says it all.  Please consider making this variable
customizable (a defcustom).  And consider documenting it in the Emacs
manual.

See, e.g., https://emacs.stackexchange.com/q/33510/105.

In GNU Emacs 25.2.1 (x86_64-w64-mingw32)
 of 2017-04-24
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-dbus --without-compress-install 'CFLAGS=-O2
 -static -g3''





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-13 14:33 bug#27350: 25.2; Make `inhibit-compacting-font-caches' customizable Drew Adams
@ 2017-06-13 15:02 ` Eli Zaretskii
  2017-06-13 17:02   ` Drew Adams
  2017-06-15 11:53 ` bug#27350: #27350 " Felix E. Klee
  2019-09-13 12:45 ` Stefan Kangas
  2 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2017-06-13 15:02 UTC (permalink / raw)
  To: Drew Adams; +Cc: 27350

tag 27350 wontfix
quit

> Date: Tue, 13 Jun 2017 07:33:34 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> Subject line says it all.  Please consider making this variable
> customizable (a defcustom).  And consider documenting it in the Emacs
> manual.
> 
> See, e.g., https://emacs.stackexchange.com/q/33510/105.

This variable is a "fire escape": it only exists because we were
unable to fix some of the situations where the slow-down happens (in
other cases changing the end-user font configuration fixed the
problem).  Ideally, it will some day go away.  Making it a defcustom
and documenting it will make removing it harder.

So no, I don't think we should do what you suggest, leaky postings on
Stackexchange notwithstanding.  (And those postings actually harm the
project, because all such problems should be reported as bugs,
allowing us to investigate as many of these problems as possible, and
hopefully helping us eventually find the culprit.  "Solving" them on
Stackexchange avoids bringing more of such problems to our attention.)





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-13 15:02 ` Eli Zaretskii
@ 2017-06-13 17:02   ` Drew Adams
  2017-06-13 19:41     ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Drew Adams @ 2017-06-13 17:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 27350

> This variable is a "fire escape": it only exists because we were
> unable to fix some of the situations where the slow-down happens (in
> other cases changing the end-user font configuration fixed the
> problem).  Ideally, it will some day go away.  Making it a defcustom
> and documenting it will make removing it harder.

I see.  In that case, agreed.  Perhaps NEWS should characterize it
that way, instead of nearly suggesting that it is a user variable:

 "Set this variable to a non-nil value to speed up display of
  ^^^^^^^^^^^^^^^^^
  characters using large fonts, at the price of a larger memory
  footprint."

> So no, I don't think we should do what you suggest, leaky postings on
> Stackexchange notwithstanding.  (And those postings actually harm the
> project, because all such problems should be reported as bugs,
> allowing us to investigate as many of these problems as possible, and
> hopefully helping us eventually find the culprit.  "Solving" them on
> Stackexchange avoids bringing more of such problems to our attention.)

I'm glad I brought it to your attention, in that case. ;-)

You know where to find the person with the problem, if you
want more info about that specific case.

And you can also consider addressing the referenced "GitHub
discussion thread" (I haven't looked at it), either to get
further info about specific problems encountered or to let
folks there know that you would prefer that they raise an
Emacs bug.

Both of those references should presumably help you gather
info about "as many of these problems as possible".





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-13 17:02   ` Drew Adams
@ 2017-06-13 19:41     ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2017-06-13 19:41 UTC (permalink / raw)
  To: Drew Adams; +Cc: 27350

> Date: Tue, 13 Jun 2017 10:02:17 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: 27350@debbugs.gnu.org
> 
> I'm glad I brought it to your attention, in that case. ;-)

But you didn't: the problem reported by the OP doesn't reproduce on my
machine.  That's why we need the people who actually have those
problems to talk to us: we need to ask them to try several things in
order to attempt to find the reason.

> And you can also consider addressing the referenced "GitHub
> discussion thread"

I'm familiar with that thread, and the problem reported there is fixed
in Emacs 26.  So no, that doesn't help either.

> Both of those references should presumably help you gather
> info about "as many of these problems as possible".

They don't.  We need to have people with the problem report the
details and be ready to work with us on them.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-13 14:33 bug#27350: 25.2; Make `inhibit-compacting-font-caches' customizable Drew Adams
  2017-06-13 15:02 ` Eli Zaretskii
@ 2017-06-15 11:53 ` Felix E. Klee
  2017-06-15 14:38   ` Eli Zaretskii
  2019-09-13 12:45 ` Stefan Kangas
  2 siblings, 1 reply; 16+ messages in thread
From: Felix E. Klee @ 2017-06-15 11:53 UTC (permalink / raw)
  To: 27350

Hi there! I am the guy who asked on StackExchange. Let me know if there
is anything that I can do to help you reproduce the bug.

Perhaps the fonts that are on my system are an issue. Browsing through
the characters in [unicode.txt][1] and with ‘xub-mode’ enabled, I find
four fonts:

 -- -outline-Consolas-normal-normal-normal-mono-16-*-*-*-c-*-iso8859-1

 -- -outline-BatangChe-normal-normal-normal-mono-16-*-*-*-c-*-gb2312.1980-0

 -- -outline-MS Gothic-normal-normal-normal-mono-16-*-*-*-c-*-jisx0208*-*

 -- -outline-Symbola-normal-normal-normal-serif-16-*-*-*-p-*-iso10646-1

If there is a way to list all the fonts used in a file, I’m curious to
hear about it.

Hardware: ThinkPad T420s

Operating system: 64bit Windows 7

Text editor: GNU Emacs 25.2.1 (x86_64-w64-mingw32) of 2017-04-24

[1]: http://ergoemacs.org/emacs/unicode.txt





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-15 11:53 ` bug#27350: #27350 " Felix E. Klee
@ 2017-06-15 14:38   ` Eli Zaretskii
  2017-06-15 15:46     ` Felix E. Klee
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2017-06-15 14:38 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: 27350

> From: "Felix E. Klee" <felix.klee@inka.de>
> Date: Thu, 15 Jun 2017 13:53:32 +0200
> 
> Hi there! I am the guy who asked on StackExchange. Let me know if there
> is anything that I can do to help you reproduce the bug.

Thanks for showing up.

> Perhaps the fonts that are on my system are an issue. Browsing through
> the characters in [unicode.txt][1] and with ‘xub-mode’ enabled, I find
> four fonts:
> 
>  -- -outline-Consolas-normal-normal-normal-mono-16-*-*-*-c-*-iso8859-1
> 
>  -- -outline-BatangChe-normal-normal-normal-mono-16-*-*-*-c-*-gb2312.1980-0
> 
>  -- -outline-MS Gothic-normal-normal-normal-mono-16-*-*-*-c-*-jisx0208*-*
> 
>  -- -outline-Symbola-normal-normal-normal-serif-16-*-*-*-p-*-iso10646-1
> 
> If there is a way to list all the fonts used in a file, I’m curious to
> hear about it.

It should be easy to write a function that goes over all the face
changes in a buffer and adds the faces' fonts to some list.  However,
what we really want is not the list of all the fonts, but only those
fonts which slow down redisplay.  So what I suggest is to move point
slowly through the buffer, notice the positions where it takes Emacs
significantly more time to update the cursor position, and then look
at the fonts only in those places.

(My guess would be that Ming-Liu, Batang-Che, and perhaps also Gothic
are the offending fonts.)

FWIW, on my system most of the funny characters are displayed using
Arial Unicode MS, and I see no perceptible slowdown.  Maybe you could
try setting up Emacs to do the same, and see if the problem goes
away.  Let me know if you need guidance for how to set that up.

Thanks.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-15 14:38   ` Eli Zaretskii
@ 2017-06-15 15:46     ` Felix E. Klee
  2017-06-15 16:01       ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Felix E. Klee @ 2017-06-15 15:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 27350

When I prepared the list, I was in Emacs with my configuration. Now in
Emacs started with option ‘-Q’ fonts are slightly different:

  -- -outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1

  -- -outline-BatangChe-normal-normal-normal-mono-13-*-*-*-c-*-gb2312.1980-0

  -- -outline-MS Gothic-normal-normal-normal-mono-13-*-*-*-c-*-jisx0208*-*

  -- -outline-MS Gothic-normal-normal-normal-mono-13-*-*-*-c-*-jisx0208*-*

On Thu, Jun 15, 2017 at 4:38 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> However, what we really want is not the list of all the fonts, but
> only those fonts which slow down redisplay.

Everything is slow. Even navigating point over the Latin (Courier)
characters is slow.

> I see no perceptible slowdown.

Maybe your system is faster. I suggest using a CPU monitor and moving
point around in ‘unicode.txt’. In the Windows Task manager, when doing
that, I see Emacs maxing out one entire CPU thread (25%, as my CPU has
four threads).

> Let me know if you need guidance for how to set that up. [Arial
> Unicode MS]

If you could post the necessary config lines, that would be great! The
font is installed on my system.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-15 15:46     ` Felix E. Klee
@ 2017-06-15 16:01       ` Eli Zaretskii
  2017-06-15 16:23         ` Felix E. Klee
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2017-06-15 16:01 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: 27350

> From: "Felix E. Klee" <felix.klee@inka.de>
> Date: Thu, 15 Jun 2017 17:46:25 +0200
> Cc: 27350@debbugs.gnu.org
> 
> > However, what we really want is not the list of all the fonts, but
> > only those fonts which slow down redisplay.
> 
> Everything is slow. Even navigating point over the Latin (Courier)
> characters is slow.

Even if you shrink the window so that only Latin characters are
visible?

> > I see no perceptible slowdown.
> 
> Maybe your system is faster.

I sincerely doubt that.  This box is 5 years old, it cannot be too
fast by today's standards.

> If you could post the necessary config lines, that would be great! The
> font is installed on my system.

OK, will do later.  As a first approximation, try this:

  emacs -Q -fn "Arial Unicode MS"

This will make that font the default font, and Emacs should also use
it for most/all the funny characters that are supported by Arial.  I'd
be interested to know if this is still slow.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-15 16:01       ` Eli Zaretskii
@ 2017-06-15 16:23         ` Felix E. Klee
  2017-06-15 18:23           ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Felix E. Klee @ 2017-06-15 16:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 27350

On Thu, Jun 15, 2017 at 6:01 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> Even if you shrink the window so that only Latin characters are
> visible?

That does the trick. Fonts that are unproblematic:

  -- -outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1

  -- -outline-Symbola-normal-normal-normal-serif-13-*-*-*-p-*-iso10646-1

  -- -outline-BatangChe-normal-normal-normal-mono-13-*-*-*-c-*-gb2312.1980-0

Fonts that cause a slow-down:

  -- -outline-MingLiU-normal-normal-normal-mono-13-*-*-*-c-*-iso10646-1

  -- -outline-MS Gothic-normal-normal-normal-mono-13-*-*-*-c-*-jisx0208*-*

>   emacs -Q -fn "Arial Unicode MS"

Indeed that makes the problem go away. Still it’s not a solution as I
prefer the other fonts, and I don’t see why they should be avoided.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-15 16:23         ` Felix E. Klee
@ 2017-06-15 18:23           ` Eli Zaretskii
  2017-06-16 10:20             ` Felix E. Klee
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2017-06-15 18:23 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: 27350

> From: "Felix E. Klee" <felix.klee@inka.de>
> Date: Thu, 15 Jun 2017 18:23:44 +0200
> Cc: 27350@debbugs.gnu.org
> 
> On Thu, Jun 15, 2017 at 6:01 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > Even if you shrink the window so that only Latin characters are
> > visible?
> 
> That does the trick. Fonts that are unproblematic:
> 
>   -- -outline-Courier New-normal-normal-normal-mono-13-*-*-*-c-*-iso8859-1
> 
>   -- -outline-Symbola-normal-normal-normal-serif-13-*-*-*-p-*-iso10646-1
> 
>   -- -outline-BatangChe-normal-normal-normal-mono-13-*-*-*-c-*-gb2312.1980-0
> 
> Fonts that cause a slow-down:
> 
>   -- -outline-MingLiU-normal-normal-normal-mono-13-*-*-*-c-*-iso10646-1
> 
>   -- -outline-MS Gothic-normal-normal-normal-mono-13-*-*-*-c-*-jisx0208*-*

Right.

> >   emacs -Q -fn "Arial Unicode MS"
> 
> Indeed that makes the problem go away. Still it’s not a solution as I
> prefer the other fonts, and I don’t see why they should be avoided.

I didn't mean to suggest that this is the solution, just make sure
that it isn't the characters themselves that cause this, it's the
fonts used to display them.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-15 18:23           ` Eli Zaretskii
@ 2017-06-16 10:20             ` Felix E. Klee
  2017-06-16 13:00               ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Felix E. Klee @ 2017-06-16 10:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 27350

FYI, a 2005 fontconfig bug report about slowness when loading MingLiU:

https://bugs.freedesktop.org/show_bug.cgi?id=3838

The solution is caching: “TrueType fonts are broken in various ways;
fontconfig works around this by scanning the entire font once and
caching the result. That's why it caches things.”

Caching is fine with me.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-16 10:20             ` Felix E. Klee
@ 2017-06-16 13:00               ` Eli Zaretskii
  2017-06-16 13:24                 ` Felix E. Klee
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2017-06-16 13:00 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: 27350

> From: "Felix E. Klee" <felix.klee@inka.de>
> Date: Fri, 16 Jun 2017 12:20:48 +0200
> Cc: 27350@debbugs.gnu.org
> 
> FYI, a 2005 fontconfig bug report about slowness when loading MingLiU:
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=3838
> 
> The solution is caching: “TrueType fonts are broken in various ways;
> fontconfig works around this by scanning the entire font once and
> caching the result. That's why it caches things.”

Thanks for that data point.


> Caching is fine with me.

Patches are welcome.  (I know almost nothing about fonts.)





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-16 13:00               ` Eli Zaretskii
@ 2017-06-16 13:24                 ` Felix E. Klee
  2017-06-16 13:47                   ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Felix E. Klee @ 2017-06-16 13:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 27350

On Fri, Jun 16, 2017 at 3:00 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Caching is fine with me.
>
> Patches are welcome.  (I know almost nothing about fonts.)

‘inhibit-compacting-font-caches’ does the trick, at least for me. When I
open ‘unicode.txt’, then the memory footprint of EMACS increases by
about 13 MB. That is less than 2 ‰ of my system memory, negligible.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-16 13:24                 ` Felix E. Klee
@ 2017-06-16 13:47                   ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2017-06-16 13:47 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: 27350

> From: "Felix E. Klee" <felix.klee@inka.de>
> Date: Fri, 16 Jun 2017 15:24:58 +0200
> Cc: 27350@debbugs.gnu.org
> 
> On Fri, Jun 16, 2017 at 3:00 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> >> Caching is fine with me.
> >
> > Patches are welcome.  (I know almost nothing about fonts.)
> 
> ‘inhibit-compacting-font-caches’ does the trick, at least for me. When I
> open ‘unicode.txt’, then the memory footprint of EMACS increases by
> about 13 MB. That is less than 2 ‰ of my system memory, negligible.

That variable inhibits compacting the frames' font caches globally.
That is, they will never be compacted.  So measuring the increase of
the memory footprint for a small number of fonts is not the worst use
case.  An average system nowadays has many hundreds of fonts
installed.

Anyway, if that variable does the trick for you, and you are happy
with it, by all means keep using it.  That's why I added it.  I just
hoped we will be able to find a better solution, but I guess not yet.

Thanks.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2017-06-13 14:33 bug#27350: 25.2; Make `inhibit-compacting-font-caches' customizable Drew Adams
  2017-06-13 15:02 ` Eli Zaretskii
  2017-06-15 11:53 ` bug#27350: #27350 " Felix E. Klee
@ 2019-09-13 12:45 ` Stefan Kangas
  2019-09-13 13:47   ` Eli Zaretskii
  2 siblings, 1 reply; 16+ messages in thread
From: Stefan Kangas @ 2019-09-13 12:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 27350-done, Felix E. Klee

Eli Zaretskii <eliz@gnu.org> writes:

> Anyway, if that variable does the trick for you, and you are happy
> with it, by all means keep using it.  That's why I added it.  I just
> hoped we will be able to find a better solution, but I guess not yet.

inhibit-compacting-font-caches is now t by default on Windows.  Can we
therefore close this bug report?

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#27350: #27350 25.2; Make `inhibit-compacting-font-caches' customizable
  2019-09-13 12:45 ` Stefan Kangas
@ 2019-09-13 13:47   ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2019-09-13 13:47 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 27350, felix.klee

> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 13 Sep 2019 14:45:33 +0200
> Cc: "Felix E. Klee" <felix.klee@inka.de>, 27350-done@debbugs.gnu.org
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Anyway, if that variable does the trick for you, and you are happy
> > with it, by all means keep using it.  That's why I added it.  I just
> > hoped we will be able to find a better solution, but I guess not yet.
> 
> inhibit-compacting-font-caches is now t by default on Windows.  Can we
> therefore close this bug report?

It's fine with me to close it, but the fact that the variable is now
non-nil by default on MS-Windows has nothing to do with the decision
whether to close it.  I expressed my opinion about this long ago by
tagging it as wontfix.

Thanks.





^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-09-13 13:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-13 14:33 bug#27350: 25.2; Make `inhibit-compacting-font-caches' customizable Drew Adams
2017-06-13 15:02 ` Eli Zaretskii
2017-06-13 17:02   ` Drew Adams
2017-06-13 19:41     ` Eli Zaretskii
2017-06-15 11:53 ` bug#27350: #27350 " Felix E. Klee
2017-06-15 14:38   ` Eli Zaretskii
2017-06-15 15:46     ` Felix E. Klee
2017-06-15 16:01       ` Eli Zaretskii
2017-06-15 16:23         ` Felix E. Klee
2017-06-15 18:23           ` Eli Zaretskii
2017-06-16 10:20             ` Felix E. Klee
2017-06-16 13:00               ` Eli Zaretskii
2017-06-16 13:24                 ` Felix E. Klee
2017-06-16 13:47                   ` Eli Zaretskii
2019-09-13 12:45 ` Stefan Kangas
2019-09-13 13:47   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.