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

Memory Usage

Note: Memory usage was not measured in this run

Analysis

Key Findings

Measured Results:

  1. Rendering Speed: 193.9x faster on average for single diagrams

  2. Batch Processing: 115.1x faster for rendering 50 diagrams

  3. Startup Time (cold start): 2.2x faster

  4. 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.

  1. No Browser Overhead: Direct SVG generation without browser engine

  2. Native Ruby: No V8/Node.js context switching

  3. Parslet-Based Parsers: No separate JS runtime for grammar parsing

  4. No IPC: Everything runs in a single process

  5. No Chrome instance required (memory usage itself was not measured in this run)

Where This Can Matter

  1. CI/CD Pipelines: Fewer runtime dependencies to install in a build image

  2. Batch Documentation Generation: No per-process browser-launch overhead

  3. Server-Side Rendering: No browser process to launch per request

  4. Ruby-Native Applications: No external dependencies

When to Consider Mermaid.js

  1. Interactive Features: Browser-based editing and interaction

  2. Live Preview: Real-time diagram editing

  3. Client-Side Rendering: When rendering must happen in browser

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


Back to top

Copyright © 2025 Ribose. Sirena is open source under the BSD-2-Clause license.

This site uses Just the Docs, a documentation theme for Jekyll.