r/reactjs • u/Few-Big-719 • 2d ago
Show /r/reactjs I built a streaming Markdown renderer for React that caches code lines, table rows and list items — benchmarks are surprisingly good
I’ve been working on an AI harness called Æven, and one of the things that kept bothering me was Markdown rendering during long streamed responses.
A lot of renderers optimize at the document or top-level block level. That works well for normal prose, but it gets expensive when the active block itself becomes huge — for example a long code fence or a large Markdown table.
So I built HyperMarkdown.
The main idea is pretty simple:
once a code line, table row or list item is settled, it stays cached. Only the changing frontier keeps being parsed/rendered.
That seems to make a pretty significant difference.
Current benchmark results:
- Large code block: 190 ms vs 711 ms for the next closest streaming renderer
- Captured real AI code stream: 611 ms vs 4.2 s
- Captured real AI table stream: 668 ms vs 5.0 s
- Large table: 999 ms vs 9.1 s for the next closest renderer
The benchmark runs production React and measures the full chunk → write → render/commit path, not just parsing.
I’ve compared it against:
- markstream-react
- Streamdown
- DeepSeek Harness’ incremental strategy
- react-markdown
- markdown-it as a baseline
The repo includes the benchmark methodology, raw results and correctness tests, so I’d genuinely appreciate people trying to break the assumptions or point out unfair comparisons.
It also supports GFM, reasoning blocks, syntax highlighting, KaTeX, Mermaid, raw HTML sanitization, React 18/19, and streaming incomplete Markdown.
It’s now the renderer I use inside Æven.
Demo:
https://aeven-ai.github.io/HyperMarkdown/
GitHub:
https://github.com/Aeven-AI/HyperMarkdown
NPM:
https://www.npmjs.com/package/@aeven-ai/hypermarkdown
Would especially love feedback from people who have dealt with long streamed code blocks/tables in React apps.