Skip to content

Comparison with Other Solutions

This guide provides a deep technical comparison between Incremark, Ant Design X Markdown, and MarkStream Vue, analyzing their architectural implementation of streaming Markdown rendering.

Architecture & Flow

1. Incremark (Our Solution)

Strategy: Incremental Parsing + Structural Typewriter Animation

  • Key Advantage: Only parses what is new or unstable. Animation happens at the AST node level, avoiding re-traversal of stable nodes. Performance is O(N).

2. Ant Design X (x-markdown)

Strategy: Regex Repair + Full Re-parsing (Marked)

  • Key Advantage: Robust visual state patching via regex. However, it requires a full re-parse of the entire accumulated string on every update. Performance is O(N²).

3. MarkStream Vue

Strategy: Full Re-parsing + Virtualized/Batched Rendering (markdown-it)

  • Key Advantage: Accepts the cost of re-parsing but optimizes the DOM layer via virtualization and idling batch updates. Perfect for viewing extremely large history or static documents.

Technical Comparison Matrix

DimensionAnt Design X (epx)MarkStream Vue (epx2)Incremark (core)
Parsing Enginemarkedmarkdown-itDual-Engine: marked (default) + micromark
Parsing StrategyFull Re-parseFull Re-parseIncremental Parsing
Parsing ComplexityO(N²)O(N²)O(N)
Boundary HandlingRegex InterceptionRegex PatchingState-based Boundary Detection
Typewriter EffectText Layer (String slicing)Component Layer (<transition>)AST Node Layer (Incremental Append)
Animation PerfDegrades with content lengthO(1) per mountingConstant CPU usage per tick
Big Doc OptimizationNoneVirtualization + BatchingStable IDs + Selective Rendering
Plugin EcosystemLimitedmarkdown-it pluginsmicromark + mdast + marked extensions
Framework SupportReactVueVue + React + Svelte (Shared Core)

Deep Dive

1. Incremental vs Full Parsing

For a 10,000-character document with 10 new characters added:

  • Full Parsing: The parser must scan all 10,010 characters. Processing time grows exponentially with conversation length.
  • Incremental Parsing: IncremarkParser identifies the first 10,000 characters as belonging to "stable blocks" and only performs limited contextual analysis on the new 10 characters.

2. Animation Precision

  • Text Layer (Ant Design X): The animator doesn't know if a character belongs to a heading or a code block; it just slices a string. This can cause structural "jumping" during high-frequency updates.
  • Component Layer (MarkStream Vue): Animation is often restricted to paragraph or block-level fade-ins, making it hard to achieve a smooth, character-by-character "typewriter" feel.
  • AST Layer (Incremark): BlockTransformer is aware of the AST structure. It knows exactly where the new text nodes are. By maintaining a TextChunk queue within nodes, it enables smooth character-level animation while maintaining structural integrity (e.g., ensuring a **bold** block never crashes the renderer mid-animation).

Conclusion & Best Use Cases

Ant Design X (The Design System Choice)

  • Best For: Rapidly building AI chat interfaces for web applications already using Ant Design. Its regex repair strategy is very reliable for common Markdown edge cases in shorter chats.

MarkStream Vue (The Document Viewer)

  • Best For: Vue applications that need to display extremely large AI responses or long-form documents where virtualization (scrolling performance) is the priority.

Incremark (The High-Performance Standard)

  • Best For: Corporate-grade AI applications with long context windows (100k+ tokens), multi-framework teams, or any scenario where the smoothest possible "human-like" typing animation is required without sacrificing battery life or performance.

Benchmark Results

We conducted extensive benchmarks across 38 real-world markdown documents (6,484 lines, 128.55 KB total).

📊 See the complete benchmark data for detailed results of all 38 test files.

Overall Performance (Averages)

ComparisonAverage Advantage
vs Streamdown~6.1x faster
vs ant-design-x~7.2x faster
vs markstream-vue~28.3x faster

⚠️ These are averages across all test scenarios. Individual performance varies by content type.

Scaling with Document Size

The larger the document, the greater Incremark's advantage — O(n) vs O(n²):

FileLinesSizeIncremarkant-design-xAdvantage
introduction.md341.57 KB5.6 ms12.8 ms2.3x
comparison.md1095.39 KB20.5 ms85.2 ms4.1x
BLOCK_TRANSFORMER.md4899.24 KB75.7 ms619.9 ms8.2x
test-md-01.md91617.67 KB87.7 ms1656.9 ms18.9x 🚀

Understanding Performance Differences

Why Incremark is Sometimes "Slower" vs Streamdown

In some benchmarks, Incremark appears slower than Streamdown:

FileIncremarkStreamdownReason
footnotes.md1.7 ms0.2 msStreamdown doesn't support footnotes
FOOTNOTE_FIX_SUMMARY.md22.7 ms0.5 msSame — skips footnote parsing

This is a feature difference, not a performance issue:

  • Streamdown skips unsupported syntax → appears faster
  • Incremark fully parses footnotes, math, containers → does more work

Incremark's Enhanced Features

Incremark extends Marked with custom extensions that Streamdown doesn't support:

FeatureIncremarkStreamdown
Footnotes✅ Full GFM footnotes❌ Not supported
Math Blocks$...$ and $$...$$⚠️ Partial
Custom Containers:::tip, :::warning❌ Not supported
Inline HTML Parsing✅ Full HTML tree⚠️ Basic

Where Incremark Truly Shines

For standard markdown (no footnotes), Incremark consistently outperforms:

FileLinesIncremarkStreamdownvs Streamdown
concepts.md9112.0 ms50.5 ms4.2x
complex-html-examples.md1479.0 ms58.8 ms6.6x
OPTIMIZATION_SUMMARY.md39119.1 ms208.4 ms10.9x
test-md-01.md91687.7 ms1441.1 ms16.4x

Why Incremark Excels

  1. Incremental Parsing O(n): Each append only processes new content
  2. Linear Scaling: Advantage grows with document size
  3. Streaming-Optimized: Microsecond-level chunk processing
  4. Feature-Rich: Supports footnotes, math, containers without sacrificing speed

Ideal Use Cases

Incremark shines in:

  • AI chat with streaming output (Claude, ChatGPT, etc.)
  • Real-time markdown editors
  • Large document incremental rendering
  • Long-running conversations with 100k+ tokens
  • Content requiring footnotes, math, or custom containers

⚠️ Consider alternatives for:

  • One-time static markdown rendering
  • Very small files (<500 characters)