all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 30539@debbugs.gnu.org
Subject: bug#30539: 26.0; `char-displayable-p' is much slower in Emacs 25 and 26
Date: Thu, 22 Feb 2018 18:43:21 -0800 (PST)	[thread overview]
Message-ID: <b1642e4a-805b-4626-853d-064b87de7700@default> (raw)
In-Reply-To: <87woz44grg.fsf@gmail.com>

> > Can someone please confirm that they can repro this problem?
> 
> I can reproduce on a Windows 10 box.  It looks like something was being
> cached before, where now it's not.  E.g., try the following function
> (char-names as defined in your throw-mule-bug-2.el).  In Emacs 24,
> there's only one slow call.
> 
> (defun my-test-each-char ()
>   (interactive)
>   (view-echo-area-messages)
>   (pcase-dolist (`(,name . ,ch) char-names)
>     (read-char (format "continue? (next: %s)" name))
>     (let ((t0 (current-time))
>           dt displayable)
>       (setq displayable (char-displayable-p ch))
>       (setq dt (subtract-time (current-time) t0))
>       (message "%s display:%s (%fs)" name displayable (float-time dt)))))
> 
> Doing (setq inhibit-compacting-font-caches t) brings back reasonable
> performance.
> 
> I can't reproduce on my GNU/Linux box, although that may just be due to
> different fonts installed.  In particular, char-displayable-p never gave
> me nil.

Thanks, Noam.  Yes, I see the same thing: over 4 sec for each
char that is not displayable.

I couldn't try your code with Emacs 24.5 because `pcase-dolist'
and `inhibit-compacting-font-caches' are both undefined.  (How
did you test it in 24.5, or did I misunderstand you?)

But everything else you say checks out, including the effect
of (setq inhibit-compacting-font-caches t).

Is this a bug that is likely to get fixed?

In any case, for Emacs 25-26, I wonder whether I should bind
`inhibit-compacting-font-caches to `t' in my code that uses
`char-displayable-p', or whether I should just skip the
`char-displayable-p' test for Emacs 25-26.

Another question is whether this bug should/will affect all
users or only some?  If the latter then I can let users
decide whether to test `char-displayable-p' (I have an
option for that anyway) or whether to bind
`inhibit-compacting-font-caches to `t'.  If only some users
are affected by the bug, do we know why?  Does it have to
do with the fonts they have installed, for example?





  reply	other threads:[~2018-02-23  2:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 22:07 bug#30539: 26.0; `char-displayable-p' is much slower in Emacs 25 and 26 Drew Adams
2018-02-20 18:08 ` Drew Adams
2018-02-22 14:50   ` Drew Adams
2018-02-23  1:49     ` Noam Postavsky
2018-02-23  2:43       ` Drew Adams [this message]
2018-02-23  3:32         ` Noam Postavsky
2018-02-23  4:07           ` Drew Adams
2018-02-23  7:14             ` Eli Zaretskii
2020-06-27 21:34           ` Drew Adams
2020-11-18 15:35       ` Stefan Kangas
2020-11-18 17:21         ` Eli Zaretskii
2020-11-18 18:30           ` Stefan Kangas
2018-02-28 19:21   ` Charles A. Roelli
     [not found] <<8c79c39f-7abb-4591-a676-17fb46af5a8f@default>
     [not found] ` <<ec3497d7-9a7d-4be8-8712-19bb6bdd96e8@default>
     [not found]   ` <<m2d10oj4xj.fsf@aurox.ch>
2018-02-28 19:53     ` Drew Adams

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

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

  git send-email \
    --in-reply-to=b1642e4a-805b-4626-853d-064b87de7700@default \
    --to=drew.adams@oracle.com \
    --cc=30539@debbugs.gnu.org \
    --cc=npostavs@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 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.