unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>, Drew Adams <drew.adams@oracle.com>
Cc: 32159@debbugs.gnu.org, moses.mason@gmail.com
Subject: bug#32159: 26.1; inhibit-compacting-font-caches does not fix all fonts lagging issue
Date: Sun, 15 Jul 2018 12:43:50 -0700 (PDT)	[thread overview]
Message-ID: <45c210aa-5a57-45f7-9bd4-752876b233c2@default> (raw)
In-Reply-To: <<837elw9vp9.fsf@gnu.org>>

> Only if some characters Emacs needs to display are not supported by
> any of those many fonts, and if the user didn't customize Emacs to
> tell that he/she doesn't _want_ those characters to be displayed,
> ever.  How reasonable is such a situation?  Not very reasonable from
> my POV.

How is a user to know which characters are problematic, and
thus perhaps to tell Emacs that s?he doesn't want/need those
chars to be displayed?

How is a user to tell Emacs that s?he doesn't want/need this
or that char to be displayed?

> > It seems, at least naively, like it should be
> > possible for a user to control this, by toning down
> > Emacs's overdrive and enthusiasm in this.
> 
> We have that way: the user should customize the fontset.

How does a user do that?  How does a user know that that
is what needs to be done?  Just what is a user supposed to
do, when s?he determines that Emacs hangs (is slow) because
it tries to search fonts?

> And what exactly is "going on", may I ask?

You tell me.  As a user, the symptom is hanging/slowdown.

> > Doesn't (can't) Emacs have a better understanding of
> > this problem than a user?
> 
> What else can Emacs do except try the fonts that might fit the bill?
> What other understanding do you expect from Emacs?  Can Emacs
> "understand" that no font is available for a given character without
> trying to find such a font?

Why would Emacs need to do that over and over?  Can't it
record that failure, so it doesn't try again in a future
session?

> > Can't Emacs learn which fonts work for which chars,
> 
> It can, and it has.  See the default fontset -- that's the database
> Emacs uses to guide the search.

I don't know how to "see" it or what to do when I do see
it.  But a naive guess would be that the default font set
isn't sufficient, if Emacs keeps hanging.

> > so that it doesn't keep trying a given font when
> > trying to display a given char, after it's already
> > determined previously that that font doesn't support
> > that char?
> 
> Emacs never tries to search for a font that supports a given character
> after it has done that once and failed.

Even across Emacs sessions?  Does it remember that that
happened, so it doesn't try the same font for the same
char in a future session?  If so, great.  In that case,
I don't see why it keeps on hanging (slowdown).

> But it will look again when
> presented with another character, or if we clear the font caches.

Is clearing the font caches something a user does (without
knowing it)?  Am I the one doing that somehow?

Based on what you said in other threads, I've already set
`inhibit-compacting-font-caches' to nil, but that doesn't
seem to have fixed the problem.

> > My question is essentially this: It seems like you
> > keep saying, and being content to say, that if too
> > may fonts are installed then Emacs can be slow / hang.
> 
> I'm saying that a system that has 5000 fonts installed and still has
> some characters not covered is misconfigured. Installing one or two
> more fonts will probably fix the problem;

So it's about installing more fonts, not uninstalling
fonts because there are too many.  Good to know, I guess.

I'll gladly install one or two more fonts.  I just need
to know what they are and where to get them.  You've often
mentioned Symbola, but I installed that long ago, and it
doesn't seem to have made any difference.

> if the user doesn't _want_ those characters to be displayed, ever,

Dunno what the chars are.  But yes, if some char is
causing Emacs to hang, in spite of the many fonts I
have installed, then at this point I'd say that it
should be ignored: no attempt made to display it.

Is there no way to just tell Emacs that, as a general
rule: don't bother trying to display any chars that
you've previously tried and failed to display?  Above,
you seem to say that Emacs already does that, but it's
not clear whether you meant in the same Emacs session
or persistently.

If it already does that across Emacs sessions then I
don't understand why the problem persists.  It seems
like it would have already learned by now that there
is no sense wasting time trying to (again) look for
a font to display such a char.

> there's a way of customizing Emacs to do that as well.

What way is that?

> Doing none of those alternatives makes no
> sense to me, if the slowdown annoys the user who is in this situation.

Those alternatives are not clear to me.  Perhaps you
could post some instructions somewhere, for what to do
if Emacs hangs because it tries to find a suitable font?

> > I expect that, even if you agree that that would be
> > desirable (which I'm not sure you do), you might
> > say only: "patches welcome".
> 
> Patches to speed up Emacs are always welcome, that's a truism.  Sadly,
> I've not seen patches in this particular are in a long, long, long,
> LONG time.

Yes, that's too bad.  But I didn't see the problem in
older releases.  At some point (relatively recently, but
I don't recall which release it was - perhaps you do),
the problem began.

> > I expect that you, Eli, are likely our only hope
> > anytime soon of addressing this problem.
> 
> I'm not your hope, I don't know enough about this stuff to redesign it
> (assuming that there is a way of redesigning it and getting better
> performance for the same level of support for various scripts).  All I
> can is try to explain how to configure your system better using the
> available features and tricks about which I do know.

OK; please do that.  It's not clear to me what a user
should try.

> That, and applying some simple band-aid, like
> inhibit-compacting-font-caches, from time to time, is
> all I can do, and am doing.

OK; thanks for that.  I did set that particular variable
to nil when you first mentioned it.

> > Can Emacs not analyze the problem while it searches
> > desperately for a font, and so be able to report
> > about which fonts seem the most useless, least used,
> > and least useful for Emacs?  That would help a user
> > think about which fonts s?he might try removing.
> 
> From the little I know, there's no answer to that question, even if
> you only ask about Emacs.  Of course, people install fonts for other
> applications as well, and might not want to uninstall fonts that get
> in Emacs's way.

That's true.  But some users, such as myself, may have
installed fonts that they don't really need and not
know exactly which fonts they might need for this or
that application.

> No, the way to solve these problems is to either install a few more
> fonts that complete/improve the coverage, and/or customize the
> fontsets to make the font search more efficient.

I'd like to know more about each of those possibilities.
I know nothing about the second (customizing fontsets).
Wrt the first, I already installed font Symbola.  I
thought you had indicated that that font should take
care of most chars Emacs itself tends to present to
users (e.g. in `Hello').  But installing Symbola didn't
seem to help.

> > And beyond putting this burden on the user, can't
> > such an analysis by Emacs be used by Emacs itself,
> > to help it try to do the right thing by default -
> > have it try dropping this or that font from its
> > search?  IOW, can't Emacs learn about the set of
> > fonts installed, and not blindly try each one
> > everytime when trying to display a given char?
> 
> We don't have infrastructure for such analysis.  And I don't think we
> have anyone on board with expertise to design and code it, even for a
> single platform, let alone all of them.  "Patches welcome", of course.

Do you have an idea why Emacs, but not other applications,
seems to have this problem?  You indicated in your answer
earlier that it's because Emacs does much more than others.

If that's the reason, is there a way for a user to dial
back some of that much-more that Emacs does?  Is there a way
for a user to get, in Emacs, the inferior-but-not-hanging
behavior of other applications?





  parent reply	other threads:[~2018-07-15 19:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-15  0:02 bug#32159: 26.1; inhibit-compacting-font-caches does not fix all fonts lagging issue Moses
2018-07-15  2:39 ` Eli Zaretskii
2018-07-15  5:50   ` Moses
2018-07-15 14:41     ` Eli Zaretskii
2018-07-16  2:35       ` Moses
2018-07-16  3:34         ` Eli Zaretskii
2018-07-17  1:38           ` Moses
2018-07-17  2:38             ` Eli Zaretskii
     [not found]     ` <<83in5ga7dc.fsf@gnu.org>
2018-07-15 16:50       ` Drew Adams
2018-07-15 18:53         ` Eli Zaretskii
2018-07-16  3:43           ` net june
2018-07-16 14:24             ` Eli Zaretskii
     [not found]     ` <<<83in5ga7dc.fsf@gnu.org>
     [not found]       ` <<0c4b0a47-267d-4c4d-8d1f-6a562ac7519b@default>
     [not found]         ` <<837elw9vp9.fsf@gnu.org>
2018-07-15 19:43           ` Drew Adams [this message]
2018-07-16 14:22             ` Eli Zaretskii
2018-07-17  2:13               ` Moses
2018-07-17  2:40                 ` Eli Zaretskii
2018-07-17  4:22                   ` Moses
2018-07-17 15:05                     ` Eli Zaretskii
2018-07-19 13:41                       ` Eli Zaretskii
2018-07-19 15:56                         ` Drew Adams
2018-07-22  5:45                       ` Moses
2018-07-22 14:06                         ` Eli Zaretskii
2018-07-22 14:52                           ` Moses
2018-07-22 15:14                             ` Eli Zaretskii
2018-07-22 15:41                               ` Moses
2018-07-22 16:02                                 ` Eli Zaretskii
2018-07-17 10:24 ` Andy Moreton
2018-07-17 15:52   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45c210aa-5a57-45f7-9bd4-752876b233c2@default \
    --to=drew.adams@oracle.com \
    --cc=32159@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=moses.mason@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).