Overview
This document presents comprehensive performance benchmarks comparing Sirena (Ruby-native Mermaid renderer) with the official Mermaid.js CLI (mmdc).
System Information
Benchmark Date: 2026-09-24T18:22:47+05:00
System Configuration:
-
Ruby Version: 3.4.8
-
Platform: arm64-darwin25
-
Sirena Version: 0.1.0
-
Mermaid CLI Version: 11.12.0
-
CPU: Apple M2
Benchmark Methodology
All benchmarks were performed:
-
Single-diagram and startup timings: 10 iterations per test (averaged)
-
Batch rendering: one timed pass over 50 diagrams (not averaged across repeats)
-
Using identical input diagrams
-
On the same system
-
With default settings for both tools
-
Cold start for startup time tests
Single Diagram Rendering
Performance for rendering individual diagrams:
| Diagram Type | Sirena | Mermaid.js | Speedup |
|---|---|---|---|
flowchart |
11.3ms |
1.33s |
118.0x faster |
sequence |
14.0ms |
1.28s |
90.9x faster |
class |
5.5ms |
1.36s |
249.8x faster |
gantt |
12.7ms |
1.21s |
94.9x faster |
pie |
2.9ms |
1.23s |
415.8x faster |
Average speedup: 193.9x faster
Batch Rendering Performance
Performance rendering 50 diagrams:
| Metric | Sirena | Mermaid.js |
|---|---|---|
Total Time |
496.8ms |
57.19s |
Per Diagram |
9.9ms |
1.14s |
Throughput |
100.7 diagrams/sec |
0.9 diagrams/sec |
Batch speedup: 115.1x faster
Startup Time
Cold start performance (time to render first diagram):
| Tool | Average Startup Time |
|---|---|
Sirena |
492.3ms |
Mermaid.js |
1.06s |
Startup speedup: 2.2x faster
Analysis
Key Findings
Measured Results:
-
Rendering Speed: 193.9x faster on average for single diagrams
-
Batch Processing: 115.1x faster for rendering 50 diagrams
-
Startup Time (cold start): 2.2x faster
-
Dependencies: No Node.js, Puppeteer, or Chrome required
Architectural Differences
These are structural facts about the two tools, not a restatement of the measured numbers above — a difference here does not imply a "faster" result on every metric or every machine.
-
No Browser Overhead: Direct SVG generation without browser engine
-
Native Ruby: No V8/Node.js context switching
-
Parslet-Based Parsers: No separate JS runtime for grammar parsing
-
No IPC: Everything runs in a single process
-
No Chrome instance required (memory usage itself was not measured in this run)
Reproduction
To reproduce these benchmarks:
# Install mermaid-cli (optional but recommended for comparison)
npm install -g @mermaid-js/mermaid-cli
# Run full benchmark
bundle exec rake benchmark:compare
# Run quick benchmark
bundle exec rake benchmark:quick
Conclusion
Measured against mermaid-cli (mmdc) on this machine:
-
193.9x faster rendering, averaged over the sample diagrams above
-
Cold start: 2.2x faster than launching mmdc (Sirena pays Ruby interpreter + gem load per process, but still starts faster here)
-
Memory usage: not measured in this run
-
Native Ruby integration (no Node.js required at render time)
These are single-machine measurements from one run, not a general claim; reproduce with the commands above before citing a number elsewhere.
Benchmark generated by Sirena Performance Suite