Subject: bug#30539: closed (Re: bug#30539: 26.0; `char-displayable-p' is much slower in Emacs 25 and 26)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 18 Nov 2020 18:31:03 +0000

Your bug report

#30539: 26.0; `char-displayable-p' is much slower in Emacs 25 and 26

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
30539: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=30539
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#30539: 26.0; `char-displayable-p' is much slower in Emacs 25 and 26
From: Stefan Kangas <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Wed, 18 Nov 2020 10:30:08 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> writes:

>> From: Stefan Kangas <[email-masked]>
>> Date: Wed, 18 Nov 2020 07:35:06 -0800
>> Cc: [email-masked]
>>
>> > 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.
>>
>> Given this change:
>>
>> commit f34f49f35e5c000a6ee070678f43d2ca38b76cad
>> Author: Eli Zaretskii <[email-masked]>
>> Date:   Sat Sep 7 12:26:08 2019 +0300
>>
>>     Set inhibit-compacting-font-caches to t by default on MS-Windows
>>
>> Is there anything left to do here, or should this bug be closed?
>
> If the problem doesn't happen on GNU/Linux, we can close this.

I think this is Windows specific indeed.  Closing.

Subject: 26.0; `char-displayable-p' is much slower in Emacs 25 and 26
From: Drew Adams <[email-masked]>
To: [email-masked]
Date: Mon, 19 Feb 2018 14:07:40 -0800 (PST)
List-Id: <debbugs-submit.debbugs.gnu.org>

This is not from emacs -Q, and I do have many fonts installed.  I
repeated it from emacs -Q and I've attached those profiler reports
also.  But with emacs -Q the test code (`my-test') finished
immediately.  With my setup it took many seconds.  I use this font
by default - dunno whether that makes the difference:

(font . "-outline-Lucida Console-normal-normal-normal-mono-4-*-*-*-c-*-iso8859-1")
(font-parameter . "-*-Lucida Console-normal-r-*-*-14-*-*-*-c-*-iso8859-1")

Recipe I followed:

Evaluate the attached code (`throw-mule-bug.el'), then look at buffers
*CPU Profiler Report* and *Memory Profiler Report*.  I've attached these
reports as files:

throw-mule-bug-memory-report-E26-Q - Emacs 26 from emacs -Q
throw-mule-bug-cpu-report-E26-Q    - Emacs 26 from emacs -Q
throw-mule-bug-memory-report-E24 - Emacs 24.5 with my setup
throw-mule-bug-cpu-report-E24    - Emacs 24.5 with my setup
throw-mule-bug-memory-report-E26 - Emacs 26P2 with my setup
throw-mule-bug-cpu-report-E26    - Emacs 26P2 with my setup
 
In Emacs 25.3.1 and 26 `char-displayable-p' is MUCH slower
than it is in Emacs 24.5.  In 24.5 the evaluation of `my-test'
seems instantaneous.  In Emacs 26 it takes many seconds.

>From the reports, using my setup:

E26 memory:

- my-delete-if-not                         225,165,075  52%
 - let                                     222,218,069  51%
  - while                                  222,218,069  51%
   - if                                    222,218,069  51%
    - not                                  222,218,069  51%
     - funcall                             222,218,069  51%
      - my-char-displayable-p              222,218,069  51%
       - char-displayable-p                222,218,069  51%
        - cond                             222,218,069  51%
           let                             189,022,646  43%
 - while                                     2,947,006   0%
  - and                                      2,947,006   0%
   - not                                     2,947,006   0%
    - funcall                                2,947,006   0%
     - my-char-displayable-p                 2,947,006   0%
      - char-displayable-p                   2,947,006   0%
       - cond                                2,947,006   0%
          let                                1,836,898   0%

E26 cpu:

- my-delete-if-not                                1609  70%
 - let                                            1602  70%
  - while                                         1602  70%
   - if                                           1602  70%
    - not                                         1602  70%
     - funcall                                    1602  70%
      - my-char-displayable-p                     1602  70%
       - char-displayable-p                       1602  70%
        - cond                                    1602  70%
           let                                    1602  70%
 - while                                             7   0%
  - and                                              7   0%
   - not                                             7   0%
    - funcall                                        7   0%
     - my-char-displayable-p                         7   0%
      - char-displayable-p                           7   0%
       - cond                                        7   0%
          let                                        7   0%

In GNU Emacs 26.0.91 (build 1, x86_64-w64-mingw32)
 of 2018-01-22
Repository revision: 752fba992b793a74d202c9cfc3e1a92fd458e748
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''