RapiDocRapiDocv15.0
Architecture & High-Scale Benchmarks

Engineered for Speed.
Zero DOM Bloat at Any Scale.

Discover how RapiDoc parses and renders multi-megabyte OpenAPI specifications in under 500 milliseconds using native W3C Web Components, a pure ESM distribution, the CSS Custom Highlight API, and a non-blocking streaming engine.

~183 KB
Self-Contained Bundle
Gzipped single script (664 KB minified). Zero external stylesheets, no font downloads, no framework overhead.
0 ms
Virtual DOM Diffing
Native W3C Web Component. Reactive direct DOM updates with zero tree diffing lag or memory leaks.
0 Elements
Nested Code Token Spans
W3C CSS Custom Highlight API paints syntax directly on raw text. No 50,000-span DOM explosion.
< 450 ms
900+ Endpoints Rendered
Sub-half-second initial paint on massive enterprise specifications with 1,100+ operations.
Live Interactive Lab

Benchmark Real Large Specs

Test real OpenAPI specifications live in your browser. Measure exact parsing and rendering times with high-precision browser timers.

Select Specification:
Petstore 3.2Baseline, 29.1 KB
Stripe Deep SchemaDeep Schemas, 7.0 MB
GitHub Large1,100+ Operations, 8.2 MB
Render Mode:
FocusedFastest - 1 active endpoint
ViewCollapsible sections
ReadFull linear document
Spec File Size4.8 MB
Total Operations917
Render & Parse TimeReady to test
Click "Run Benchmark" to render live

Interactive Performance Sandbox

Choose an enterprise specification above and click Run Benchmark to load and time RapiDoc live.

Empirical Results

Tested Specifications & Benchmark Metrics

Measured in Chromium on Apple Silicon (M-series) running single-threaded JavaScript execution:

SpecificationFormatFile SizeOperationsFocused ModeView ModeRead ModeDOM Nodes (Focused)Scroll Stability
Petstore 3.2
Swagger Petstore (OpenAPI 3.2)
OpenAPI 3.2.029.1 KB22~54 ms~31 ms~62 ms~187 nodes60 FPS
Stripe Deep Schema
Deep Recursive Schema Tree
OpenAPI 3.0.07.00 MB644~783 ms~824 ms~4.61 s~1,998 nodes60 FPS
GitHub Large
Massive Enterprise API Matrix
OpenAPI 3.1.08.19 MB1128~1.07 s~1.11 s~3.59 s~3,833 nodes60 FPS
Engineering Deep Dive

Why RapiDoc Outperforms Traditional Documentation

Four foundational engineering breakthroughs that enable instantaneous loads and flat memory profiles:

Design & Tooling~183 KB gzipped

Ultra-Lean Bundle by Design

The ~183 KB gzipped size is not from post-build compression tricks, but deliberate design and tooling choices. By relying on native browser standards, lightweight Lit primitives, and zero third-party UI framework runtimes or external CSS stylesheets, RapiDoc stays lean and bloat-free.

Deliberate ArchitectureZero External CSSNo Framework Bloat
Modern RuntimeNative ES Modules

Native ESM Build (Modern JS)

RapiDoc is compiled and distributed as standard ECMAScript Modules (ESM), fully aligned with modern browser engines and modern bundlers (Vite, Rollup, Webpack 5).

Native Browser LoadingHTTP/2 StreamingUniversal Frameworks
DOM Engine0 ms VDOM Diffing

Native Web Component

Built on W3C Web Component standards powered by Lit. Traditional React or Vue documentation tools must create and reconcile an internal Virtual DOM tree for every endpoint and schema expansion.

Direct DOM UpdatesZero GC StallsTrue Shadow DOM
Syntax RenderingW3C Highlight API

CSS Custom Highlight API

Syntax highlighters like Prism.js and Highlight.js shred code snippets into thousands of nested <span> elements. On large 2MB payloads, this generates 50,000+ DOM nodes, freezing the browser.

Zero Extra NodesFlat Memory FootprintGPU Accelerated
DOM Architecture Comparison

Traditional Highlighting vs. RapiDoc Highlighting

How RapiDoc prevents the "DOM Explosion" problem on multi-megabyte API payloads:

Traditional Highlighters (Prism / Highlight.js)

~45,000 DOM Nodes on 2MB JSON
<!-- Explodes into thousands of DOM nodes -->
<pre class="highlight">
  <span class="token punctuation">{</span>
    <span class="token property">"id"</span><span class="token punctuation">:</span> <span class="token number">101</span><span class="token punctuation">,</span>
    <span class="token property">"name"</span><span class="token punctuation">:</span> <span class="token string">"Enterprise"</span><span class="token punctuation">,</span>
    <span class="token property">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> <span class="token property">"item"</span><span class="token punctuation">:</span> <span class="token number">1</span> <span class="token punctuation">}</span>
      <!-- Repeated 10,000 times = Browser Freeze -->
    <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
</pre>

Each token creates a JavaScript DOM wrapper object, triggering high memory pressure, layout recalculations, and Garbage Collection freezes.

RapiDoc CSS Custom Highlight API

Exactly 1 DOM Node on 2MB JSON
<!-- Exactly ONE single text node in DOM -->
<pre class="m-code">
  {
    "id": 101,
    "name": "Enterprise",
    "data": [
      { "item": 1 }
    ]
  }
</pre>

/* Painted directly via GPU CSS Ranges */
::highlight(property) { color: #38bdf8; }
::highlight(number)   { color: #f59e0b; }
::highlight(string)   { color: #34d399; }

The text is never shredded into HTML tags. The browser engine styles the text ranges natively at the compositor level with zero DOM overhead.

Tuning Guide

Best Practices for 10MB+ Enterprise Documentation

Four critical tips to keep large enterprise specifications loading instantaneously:

01

Pre-Convert Swagger 2.0 to OpenAPI 3.x in CI/CD

Only If on Outdated Specs

Applicable only if your services still produce legacy Swagger 2.0 specs: Modern OpenAPI 3.0 and 3.1 specifications require zero conversion and are parsed natively without any delay. However, if RapiDoc receives an outdated Swagger 2.0 document, it must dynamically convert it in the browser on the fly, consuming 1,500ms to 4,000ms of CPU time on large files. If you maintain legacy Swagger 2.0 specs, convert them once during your build/CI pipeline instead of having every user's browser convert it:

CI/CD Pipeline (Bash)
# Optional: Only required if using legacy Swagger 2.0 specs
# 1. Install swagger2openapi globally
npm install -g swagger2openapi

# 2. Convert Swagger 2.0 to OpenAPI 3.0 during CI/CD build
swagger2openapi swagger.json --outfile openapi3.json --yaml false

# 3. Supply pre-converted spec directly to RapiDoc (zero browser conversion overhead)
<rapi-doc spec-url="/specs/openapi3.json"></rapi-doc>
02

Use Focused or View Render Modes

In render-style="read", every single endpoint and schema table is mounted into the DOM at once. For specifications with over 100 endpoints, switch to view or focused:

  • Focused ModeMounts only the single active endpoint in the DOM. Ideal for 500+ endpoint portals.
  • View ModeGroups operations into collapsible accordions, rendering endpoint details on demand.
Render Style Configuration (HTML)
<!-- Switch from "read" to "focused" or "view" mode for 100+ endpoints -->
<rapi-doc
  spec-url="/specs/enterprise-large-spec.json"
  render-style="focused"
  schema-style="table"
></rapi-doc>
03

Tune Schema Auto-Expansion Depth

Deeply nested polymorphic schemas can cause recursive model unfolding. Cap automatic expansion to level 1 or 2 using schema-expand-level="1" to preserve DOM efficiency and keep memory flat:

Production Mega-Spec Configuration (HTML)
<!-- Optimal configuration for 5MB+ mega specifications -->
<rapi-doc
  spec-url="/specs/enterprise-huge-spec.json"
  render-style="focused"
  schema-style="table"
  schema-expand-level="1"
  default-schema-tab="schema"
  show-header="false"
  color-scheme="dark"
  theme="#10b981"
  allow-try="true"
></rapi-doc>
04

Use <rapi-doc-mini> for Targeted Endpoint Cards

When embedding a single endpoint into a tutorial, changelog, or microservice documentation, avoid mounting a full developer portal. Use <rapi-doc-mini> to pluck and render only the exact endpoint needed:

Targeted Endpoint Embed (HTML)
<!-- Pluck and render only a specific endpoint from a multi-megabyte spec -->
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>

<rapi-doc-mini
  spec-url="/specs/enterprise-huge-spec.json"
  filter-operations="GET /users/{id}"
  color-scheme="dark"
></rapi-doc-mini>

Ready to Experience True Documentation Speed?

Integrate RapiDoc into your application in seconds with zero framework dependencies.