facelessuser / MarkdownPreview

Markdown preview and build plugin for Sublime Text https://facelessuser.github.io/MarkdownPreview/
Other
402 stars 53 forks source link

Slow work + Exceed github Limit after 2 days #160

Closed rusproject closed 11 months ago

rusproject commented 1 year ago

Hello! After two days of using this package I've got this message after Ctrl+S my .md file: image

Also, after adding this package to Sublime, I've noticed that saving markdown files taking longer then before, and Sublime freezing for few seconds.

I admit that the problem may be caused by my very slow and unstable internet connection (I work from such country right now), but it feels like something wrong with something else, considering first problem.

facelessuser commented 1 year ago
  1. you need to do what the dialog says and add your github token so that it is using your token and doesn't exhaust the public limit.
  2. If you don't want to auto output to HTML on every save (once you've already output the first time), then turn off enable_autoreload.
rusproject commented 1 year ago

@facelessuser, is it normal that Sublime freezes for 1 to 10 seconds, when I save the file with enable_autoreload = true?

facelessuser commented 1 year ago

It could depend on a number of things. It does generate your Markdown on save when auto-saving a new Markdown. Depending on the size of the document, the complexity of what is being parsed, and the speed of your machine, whether it is rendering locally or sending content to GitHub to render. Using the GitHub parser is obviously going to take more time as it is rendering your content using GitHub's API to parse and render your document. Since it is remotely rendering, it will be based on your internet speed as well.

rusproject commented 1 year ago

Ok, thanks, now I can see that there is no problem when I use "Markdown" option in Command Palette, instead of "Github".

By the way, the file which I am having troubles with is 25KB size, my machine is core i7-12th-gen laptop with 16GB ram, so the problem probably is in my slow internet connection. I'd understand if I would not able to see updated content immediately after saving because of that, but is it OK to freeze whole Sublime editor until generation of Markdown is ended?

facelessuser commented 1 year ago

It's not doing it asynchronously, so this is expected. It takes time to do the work. So, it's OK if you want to render on every save for live previews. Could we tap into an asynchronous event? Maybe. We'd have to spend some time looking into that and see how well it works and what, if any, race conditions we have to account for.

rusproject commented 1 year ago

It would be nice. Thanks for your attention to the problem

facelessuser commented 11 months ago

Closing as there are currently no plans for asynchronous events. It is possible we may change our minds in the future, but there is currently no bugs with our current setup.