Git Product home page Git Product logo

Comments (13)

jrblevin avatar jrblevin commented on July 2, 2024

Thanks for your report. I am aware that are some issues with lag and hanging, particularly with very large files, and I am actively looking into it. (See also #30 and #42.) This should be helpful in isolating at least one of the issues.

from markdown-mode.

hut8 avatar hut8 commented on July 2, 2024

I'm getting this also. My file is very small. Looking around briefly it appears this happens on all files. I just upgraded this morning. If I can be of more help, please let me know.

from markdown-mode.

jrblevin avatar jrblevin commented on July 2, 2024

Can you check to see whether the recent commits improved things?

from markdown-mode.

alecigne avatar alecigne commented on July 2, 2024

I have no quantitative data but I think it's better now. It doesn't hang anymore when using scroll-up-command and scroll-down-command or when folding and unfolding. However, the lag when typing fast is still here. When I type full speed, the displayed text doesn't update at all.

Edit: actually, the "typing fast" lag depends on where I am located in the file. Do you see any reason for this?

from markdown-mode.

jrblevin avatar jrblevin commented on July 2, 2024

Thanks for checking! I used the profiler to scroll through a large (> 5000 line) file and it is now much faster for me. I didn't check typing. Parsing Markdown accurately and in real time is difficult, but I will keep working to make it more efficient. I will try profiling when entering text into a large file as well to see where the bottlenecks are.

from markdown-mode.

jrblevin avatar jrblevin commented on July 2, 2024

Further profiling revealed that the insertion lag was mostly due to the after-change hook that performs wiki link fontification. I will have a patch ready soon that substantially speeds things up!

from markdown-mode.

hut8 avatar hut8 commented on July 2, 2024

Works great for me now. Thanks very much!

from markdown-mode.

jrblevin avatar jrblevin commented on July 2, 2024

@hut8 Great—I'm glad it's working better now.

@alecigne I just saw your edit. It does make sense that it could be better or worse depending on the surrounding context. Some regions may be more difficult to parse than others. When you insert characters, things have to be parsed again in case the syntax changed.

I just pushed commit acf7c5e which I think should essentially eliminate the lag when typing. Please let me know if not. For me, this makes any lag almost imperceptible in my 5000+ line file, but if it doesn't work for you then I may ask for a more specific test case.

Another thing you can do to increase performance is to set markdown-make-gfm-checkboxes-buttons to nil. When this is non-nil, markdown-mode must check all input for checkboxes.

from markdown-mode.

alecigne avatar alecigne commented on July 2, 2024

Hi,

Thank you for looking into this. Commit acf7c5e doesn't fix the lagging problem. My file is actually my PhD thesis and thus contains a LOT of references in the format:

[@chow2012]

or

[@goldberg2008; @pajerowski2007]

That may be the source of the problem. This is a format understood by pandoc-citeproc. There are also quite a lot of sections. If you give me some time, I will try and build an example file in which the problem is present, since I don't want to send you my thesis (and you really don't want to receive it) ;)

As for now, I will continue to use markdown-mode under version 01dc652.

from markdown-mode.

jrblevin avatar jrblevin commented on July 2, 2024

One option is to obfuscate your thesis while preserving the syntax. Then I could see first hand what is happening. If you are on Linux or OS X, may I suggest using tr to randomly scramble the letters while leaving the symbols, markup, and punctuation intact? Here's one suggestion:

cat thesis.md | tr '[a-zA-Z]' 'x' | tr '[0-9]' '1' > scramble.md

It translates all letters to 'x' and all numbers to '1'. If that's sufficiently obfuscated, then you could email the file to me at [email protected].

Edit: Of course, if your thesis is in French this won't handle some letters. You also could do it in Emacs:

M-x replace-regexp RET [[:alpha:]] RET x
M-x replace-regexp RET [[:digit:]] RET 1

Obviously, back up your thesis first :)

from markdown-mode.

jrblevin avatar jrblevin commented on July 2, 2024

I have also created a new branch to help us diagnose the problem without disturbing the main branch: https://github.com/jrblevin/markdown-mode/tree/diagnose-44

There are two commits of interest right now. Both are based on the current HEAD.

  1. Commit c428fe9 reverts back to the old extend-region function from the "good" commit 01dc652.
  2. Commit a8af698 is (another) alternative extend-region function that I'd like to test.

Could you check number 2 first and if that doesn't work, also try number 1? Thanks for your patience while we narrow this down.

from markdown-mode.

alecigne avatar alecigne commented on July 2, 2024

Hi,

The new version of the function (commit a8af698) fix the lagging problem. For what it's worth, c428fe9 does as well.

My thesis is indeed in French, and is about biology – so in a way it is already pretty well obfuscated! But all jokes aside if you still need the file despite the new working function, let me know and I will send it to you.

Again, thank you for your quick response.

from markdown-mode.

jrblevin avatar jrblevin commented on July 2, 2024

Excellent! Likewise, thanks for testing out these changes so quickly and helping improve markdown-mode! Good luck with your thesis—it's an honor that you're writing it in markdown-mode. Let me know if you have any other issues.

from markdown-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.