There is severe lag(>10s some times) in my markdown document (14k words) which I run within emacs. It appears that Markdown-mode seems to be computing something everysingle time I type any character and renders emacs unusable. I suspect it has to do with the above 2 pictures. The color rendering changes with every character.
Profiling was done and the contents is in this paste bin. There seems to be the
font-lock-fontify-keywords-region function that seems to be run twice, once as part of
redisplay_internal C function (50%) and the other is the
command execute (42%) function.
Further more the issue vanishes or is under much better control once indirect buffer is not running anymore. I need some guidance as to how to go further.
Things I did
Re-installed markdown-mode (to the latest available one), looked for a while on stack. Tried to remove the coloring scheme from my init file, but it still is there somehow. I use forward slashes or other special characters and checked with general syntax and that doesn't seem to be the issue. It exists even with very few characters.
When I copy and paste the same thing into another file, somehow it works well for now without any of the color rendering issues, but within a few days, I am back to the same thing.
I am running Markdown mode on my Emacs 25.3.2 based on this installation on Ubuntu 16 on Acer Nitro 5 1050 GTX graphics card with 8gb ram.
Running the following minor modes
Auto-Composition Auto-Compression Auto-Encryption Auto-Fill Blink-Cursor Diff-Auto-Refine Electric-Indent File-Name-Shadow Flyspell Font-Lock Global-Eldoc Global-Font-Lock Line-Number Menu-Bar Mouse-Wheel Tool-Bar Tooltip Transient-Mark
P.S I am very new to handling errors in emacs and I feel completely helpless without emacs to write now. Help me find my errors or atleast give me general diretions