markdown-to-jsx
markdown-to-jsx copied to clipboard
Base64 encoded images saved as a data url slows down parsing a lot.
I have a payload which freeze a tab of browser for a looong time.
**Heavy payload**\n\n![color-palette.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABGkAAAEMCAYAAAB3FevlAAAAAX...)\n\n*... the end of it*
As you can see this is a png image saved as base 64 encoded data url. The size of the image is 75kb, so I had to trim it to post the issue here. But the total size of payload seems 98.5kB.
Here is how performance tab looks like.
Seems it spend a loot of processing time to some regexp.
I just wonder is there a way to improve it somehow?
My env specs, just in case.
- [email protected]
- Google Chrome 119.0.6045.159 (arm64)
- MacOS Sonoma 14.1.1
- MacBook Pro 13-inch, M1, 2020
P.S. Is there a benchmarks that may show me how big payload the library can process in an adequate time frame?
There's likely some optimization potential here, haven't spent much time on images/links in a while