emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Miquel" <sebastien.miquel@posteo.eu>
To: emacs-orgmode@gnu.org
Subject: Typing latency
Date: Mon, 8 Feb 2021 19:24:21 +0100	[thread overview]
Message-ID: <8f36ba0c-5b96-2af4-8d19-1dbf6c9d142e@posteo.eu> (raw)

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]

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 #2: Slow.png --]
[-- Type: image/png, Size: 181899 bytes --]

             reply	other threads:[~2021-02-08 23:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 18:24 Sébastien Miquel [this message]
2021-02-09  2:16 ` Typing latency Russell Adams
2021-02-09 14:06   ` Sébastien Miquel
2021-02-09  3:23 ` Ihor Radchenko
2021-02-09 14:56   ` Sébastien Miquel
2021-02-09 15:33     ` Ihor Radchenko
2021-02-09 22:30       ` Sébastien Miquel
2021-02-10  3:38         ` Ihor Radchenko
2021-02-10  6:18       ` Timothy
2021-02-10  6:58         ` Ihor Radchenko
2021-02-10  8:56       ` Eric S Fraga
2021-02-10 23:09         ` Samuel Wales
2021-02-14  4:39         ` Timothy
2021-02-14 10:36           ` Eric S Fraga
2021-02-14 12:45             ` Timothy
2021-02-15 11:33               ` Eric S Fraga
2021-02-15 18:29               ` Sébastien Miquel
2021-02-26 19:58                 ` [PATCH] ~org-font-lock-add-priority-faces~: ensure priority cookies are in a headline Sébastien Miquel
2021-03-02  5:10                   ` Kyle Meyer
2021-02-09  9:38 ` Typing latency Eric S Fraga
2021-02-09 14:09   ` Sébastien Miquel
2021-02-09 14:23   ` Christian Thäter
2021-02-11 16:21     ` Eric S Fraga
2021-02-11 16:25 ` Maxim Nikulin
2021-02-11 16:59   ` Ihor Radchenko
2021-02-13 15:49     ` Maxim Nikulin

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.orgmode.org/

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

  git send-email \
    --in-reply-to=8f36ba0c-5b96-2af4-8d19-1dbf6c9d142e@posteo.eu \
    --to=sebastien.miquel@posteo.eu \
    --cc=emacs-orgmode@gnu.org \
    /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/org-mode.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).