Open quanticle opened 2 years ago
Either here! Markup.
Seems the traditional fontification method is laggy, looking for treesit variant now.
Hello, also experiencing extreme slow text edits in a markdown file with many links (file is just ~23K). Profiling Emacs (actually: Doom with Emacs 29.0.90) leads to the the same results as the issue reporter.
I think I've enabled tree-sitter on the markdown-mode but I'm unsure on how to check if it's enabled and - if yes - how to check and compare the results. Should and additional package be installed to interface the markdown-mode to the tree-sitter? How does that actually look like? cc @c0001 for possibly some insights :) thanks!
Uff... and now I also get bitten by this. This and the bug where markdown mode becomes slow in moderately large tables render it currently completely unusable for my projects. I am switching to org-mode
as my main markup language right now.
Hello, also experiencing extreme slow text edits in a markdown file with many links (file is just ~23K). Profiling Emacs (actually: Doom with Emacs 29.0.90) leads to the the same results as the issue reporter.
I think I've enabled tree-sitter on the markdown-mode but I'm unsure on how to check if it's enabled and - if yes - how to check and compare the results. Should and additional package be installed to interface the markdown-mode to the tree-sitter? How does that actually look like? cc @c0001 for possibly some insights :) thanks!
Sorry for almost half a year lately to reply since I've not got any notification about this cc until I review my inbox.
BTW, I've not found any markdown treesit relavance for emacs til now, so just a waiting again ...
After a deep dive into this problem I came to the conclusion that the culprit is the underlying font-lock-mode
. I'm not sure what markdown-mode
can do about this. Setting font-lock-mode
to nil
makes the issue disappear, along with the syntax highlighting (unsurprisingly).
Happy to receive feedback though. I'd like to gain a better context about the issue to open an ticket/discussion on the emacs-devel mailing list.
Why would it be font-lock's problem if the profiler says most of the time is spent inside markdown-match-italic
and markdown-inline-code-at-pos-p
?
8362 64% - markdown-match-italic
4495 34% + markdown-inline-code-at-pos-p
3747 28% + markdown-match-italic
Same here, BTW, when editing a Markdown file with lots of links in one place (table of contents).
I recently noticed that my emacs was lagging and having high CPU usage when editing markdown files with lots of links (Example file). I reloaded emacs with
emacs -Q --load <path to markdown-mode.el>
and I was able to isolate the problem to markdown-mode. I ran the profiler and I got the following trace:I'm not quite sure what's going on. It seems like it's spending an inordinate amount of time in
markdown-match-italic
, which would explain the high CPU usage, but it's not clear to me why it's spending so much time in that function. Initially, I thought it was because I was using*
to demarcate list items, which might have led to markdown-mode getting confused about unmatched italics markers, but shifting the list marker to-
did not solve the problem.I'm running emacs 27.1 on Ubuntu 21.10. I'm running
markdown-mode-20220212.728
, which is the latest that's on MELPA.If I can provide any additional information to help debug, please let me know and I'll be glad to try additional steps.