Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slowdown (or even error) with files containing a lot of comments #536

Open
aeporreca opened this issue Aug 26, 2020 · 3 comments
Open

Slowdown (or even error) with files containing a lot of comments #536

aeporreca opened this issue Aug 26, 2020 · 3 comments

Comments

@aeporreca
Copy link

aeporreca commented Aug 26, 2020

Expected Behavior

I think markdown-mode should be able to work with files containing arbitrarily many comments (in my case, the comments are automatically generated by giving the flyspell-mode command flyspell-correct-word-before-point followed by the “Accept (buffer)” menu entry).

Actual Behavior

When opening a Markdown file containing a lot of comments, such as the attached test.txt (I renamed it as .txt since I don’t know how to upload an .md file) and editing the text while the comments are visible on screen, there is a long lag before the result of the text-editing commands becomes apparent. This does not seem to happen if the comments are not visible (e.g., if you have to scroll down to see them).

When the number of comments becomes very large, such as in the attached test2.txt file, the problem becomes even worse, with an (error "Lisp nesting exceeds ‘max-lisp-eval-depth’").

Steps to Reproduce

Open test.txt and edit it, or just open test2.txt, after having renamed them to .md.

Backtrace

  • For the slowdown occurring when editing test.txt: according to the Emacs profiler, most of the time seems to be spent inside the markdown-syntax-propertize-comments function.

  • See the attached backtrace.txt for the error obtained when opening test2.txt.

Software Versions

  • Markdown Mode: version 2.5-dev
  • Emacs: 27.1
  • OS: macOS Catalina 10.15.6
@syohex
Copy link
Collaborator

syohex commented Sep 8, 2020

Sorry belated reply. Please check #543. It fixes only recursive function call issue. I suppose it is difficult to fix slow down issue.

@syohex
Copy link
Collaborator

syohex commented Sep 9, 2020

@aeporreca I have merged #543. Could you check latest version ?

@aeporreca
Copy link
Author

aeporreca commented Sep 9, 2020

@syohex, this does indeed solve the recursion issue for me (but not, as you mentioned, the other one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants