Slow syntax highlighting profile
I've just been profiling pandoc syntax as it seemed much slower than other highlighters when swapping buffers (I know: it still only takes a quarter of a second! but usually its virtually instant)
It seems the cause is running the html, javascript, css, vb, tex and yaml syntax highlighter every time, (especially html and css) wether there is code in the page or not. Is there a way of limiting this manually? eg. to just yaml and tex? It wasn't affected by:
let g:pandoc#syntax#codeblocks#embeds#langs = []
Normally it should only include html, yaml and tex, what you describe seems weird.
Still, you have to reload the syntax (syntax on) for that variable to catch on, so perhaps try that.
What made the pandoc highlighting slow in my tests were the table-related highlighting, the regexes are way complicated and take some time. I was thinking of making the syntax highlighting for this layered, so those could be loaded only on demand.
I'm not sure why the vb, javascript and css was there - It could be from another plugin, but it didn't run when I removed pandoc-sytax, so they would have to be brought in in some complex codependent way. I will look into it again when I have time and give you a bit more to go on.
Also my test pages had no tables, but if those regexes just runs anyway then yeah that would be an overhead.
I've been trying to track down why this highlighter is adding ~5 second delays to opening Markdown files and tested adding an empty array of embeded highlight languages. I found this saves 1–1.4 seconds off of my load time even when loading a file that has no code block syntax at all. Obviously this isn't my only speed problem, but I do think we should figure out how to only do whatever this costly operation is after running into codeblock syntax.