emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Typing latency


From: Sébastien Miquel
Subject: Typing latency
Date: Mon, 8 Feb 2021 19:24:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

I often get some unpleasant latency when editing org-mode
buffers. My use case combines a lot of special blocks and LaTeX
fragments, and the fontification seems to slow things down.

I've done some measurements using typometer
([[https://pavelfatin.com/typometer/]]). The numbers aren't very accurate
since it depends on external factors, such as how long the emacs
session has run.

AFAIU, the elisp profiler is useless in this case (fontification being
slow). At least my runs don't seem to report anything relevant.

The results are compiled below. In one of my use case (I've attached a
picture of what it looks like), I get up to 85 ms of delay, which is
very unpleasant.

| Mode                   | Content                    | Latency |
|------------------------+----------------------------+---------|
| Fundamental mode       | Generic                    | 25 ms |
| Org, w/o font locking  | Generic                    | 30 ms |
| Org-mode               | None                       | 30 ms |
| Org-mode               | Special blocks             | 47 ms |
| Org-mode               | LaTeX fragments            | 40 ms |
| Org-mode, new session  | Fragments + special blocks | 65 ms |
| Org-mode, long session | Fragments + special blocks | 80 ms |


 1. Is anyone experiencing something similar ?
 2. Are you aware of any better way to measure typing latency in emacs ?
 3. Is there any thing that can be done from the org-mode/elisp side of things ?  4. Would offloading the fontification to ~tree-sitter~ be a possible way forward ?

Regards,

--
Sébastien Miquel

Attachment: Slow.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]