Sublime Forum

Markdown loads very slow

#1

Hello everybody,

on my PC (not he fastest) a 4 KB markdown file takes 2-3 seconds to load.

Is there anything I can do to make it load faster? Like disabling dedicated markdown support to make Sublime Text handling it like plain text. Any help on this would be greatly appreciated.

My markdown file can be seen here:

https://raw.githubusercontent.com/stax76/mpv.net/master/README.md

Please forgive me that I’m not very experienced with Sublime Text, I use two other editors/IDE’s besides Sublime Text.

Thanks

0 Likes

#2

I open it instantly. But I can’t figure out what’s probably wrong on you side.

  • Are you using the built-in markdown syntax?
  • Does this happen even with a clean portable Sublime Text build?
0 Likes

#3

Thanks helping me on this. I don’t know if I’m using the built-in markdown, probably yes because I don’t recall having installed anything lately. I recall starting fresh some weeks ago, I don’t think I’ve installed anything, I’m gonna check right now. Is your system pretty fast, mine isn’t, CPU is i3-3220.

0 Likes

#4

What packages do you have installed?

Markdown is the most extensive and complicated core syntax because it embeds a bunch of other syntaxes for handling code blocks. If there is a problem with any of those syntaxes, then Markdown may exhibit the symptoms even if it’s not the root cause.

0 Likes

#5

I checked and found out that I’ve not installed any packages. Maybe something is broke on my side but I cannot see it. One other app I had a major performance issue as well is Firefox, 2-3 seconds for tab switching and nothing helped until I finally replaced it with Chrome which runs absolutely smooth.

0 Likes

#6

Could you check which application is using your CPU?

0 Likes

#7

The task manager don’t show that there is an application which is draining CPU time.

Is there a way I can disable markdown syntax? I’ve researched it but couldn’t find a way.

0 Likes

#8

Maybe change .md extension to be opened as said plain text before your issue is addressed.

0 Likes

#9

You may provide the list of plugins that you are using.

0 Likes

#10

Under Package Control > Settings - User I have:

{
“bootstrapped”: true
}

I don’t know what it means but since I know now how to open md as plain text I’m good, thank you.

0 Likes

#11

I can confirm @stax76’s issue about Markown. At least the first markdown file being opened in Sublime Text takes 2-5s to load and causes the RAM usage to increase by at least 60MB on Windows. The size of the file or the content doesn’t matter.

The reason seems to be the bunch of syntaxes mensioned by @ThomSmith. All embedded syntaxes and markdown are parsed and loaded to RAM. Even ST’s syntax caching system seems to hit its limits in manner of performance here.

My ST runs on a Core i5 and is installed on a SATA-SSD. Not the fastest but not the slowest hardware.

The heavy delay is just caused because ST loads dozens of embedded syntaxes, which might never be used in a single markdown file at a time.

Already filed an issue about it at

1 Like

#12

@stax76 Does the delay occur only for the first Markdown file?

0 Likes

#13

Yes, the delay happens only opening the first markdown file.

0 Likes

#14

It’s definitely the syntax compilation issue then. There’s not much that can be done about it right now given Sublime’s architecture, but the good news is that it’s only a one-time hit, and you won’t see that hit again unless the underlying syntaxes are updated (and even then, the hit would only be proportional to the number of syntaxes modified).

0 Likes

#15

I open markdown as plain text now, it’s OK because I don’t edit much markdown.

0 Likes

#16

I mean, now that it’s been compiled, you can load it as markdown and you’ll have no trouble. Like I said, it’s a one-time hit. You shouldn’t see it at all from now on.

0 Likes

#17

I cannot follow you here, how do I enable it?

0 Likes

#18

Follow the steps that @jfcherng described above to change markdown files to open with the Markdown mode once again. The compilation hit has already taken place, so you shouldn’t see it ever again. In other words, loading markdown files should be basically just as fast with the markdown mode as with the plain text mode.

0 Likes

#19

I changed it back to open markdown files with markdown syntax by default and it is slow again everytime the sublime text application is starting to open a markdown file.

Please excuse when I cannot follow you, I don’t have a lot of experience with sublime text.

0 Likes

#20

Every time you open a file? I wonder if this isn’t just a compilation issue then…

0 Likes