Subject: Re: bug#36183: 26.1; prettify-symbols-mode high CPU usage in Windows 10

From: Tassilo Horn <[email-masked]>
Date: Wed, 19 Jun 2019 19:11:20 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Eduardo Duenez <[email-masked]>
>> Date: Wed, 12 Jun 2019 17:52:23 +0000
>> 
>> "M-x prettify-symbols-mode" on a .tex buffer (AUCTeX major mode)
>> correctly prettifies symbols (Greek letters, math symbols, etc.)
>> However, any subsequent editing of the buffer becomes de facto
>> impossible because starting to type, moving, etc., results on 100%
>> usage of the CPU core emacs is running on for 1-3 seconds. If I
>> switch to another buffer or disable prettify-symbols-mode, CPU usage
>> eventually drops down to a typical 2%-4% during regular editing.
>
> Can you please send a sample file where you see this behavior?
>
> Also, do you need to use AUCTeX for this to happen, or does it happen
> even without AUCTeX, by just visiting a .tex file and activating the
> prettify-symbols-mode?

FWIW, I cannot reproduce that behavior with some arbitrary LaTeX file
with auctex 12.1.2 from ELPA or with the stock latex-mode.  So either
it's something specific with your LaTeX file or your configuration.

In addition to what Eli said, it would also be interesting to profile
what emacs does during editing and moving point.  For that, you could do
this:

1. M-x profiler-start RET cpu RET in the problematic LaTeX file.
2. Activate prettify-symbols-mode.
3. Edit and move point so that emacs heats your CPU.
4. M-x profiler-report RET and then M-x profiler-stop RET.

Send us the contents of the *CPU-Profiler-Report ...* buffer.

Bye,
Tassilo