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.
Benchmark Real Large Specs
Test real OpenAPI specifications live in your browser. Measure exact parsing and rendering times with high-precision browser timers.
Tested Specifications & Benchmark Metrics
Measured in Chromium on Apple Silicon (M-series) running single-threaded JavaScript execution:
| Specification | Format | File Size | Operations | Focused Mode | View Mode | Read Mode | DOM Nodes (Focused) | Scroll Stability |
|---|---|---|---|---|---|---|---|---|
Petstore 3.2 Swagger Petstore (OpenAPI 3.2) | OpenAPI 3.2.0 | 29.1 KB | 22 | ~54 ms | ~31 ms | ~62 ms | ~187 nodes | 60 FPS |
Stripe Deep Schema Deep Recursive Schema Tree | OpenAPI 3.0.0 | 7.00 MB | 644 | ~783 ms | ~824 ms | ~4.61 s | ~1,998 nodes | 60 FPS |
GitHub Large Massive Enterprise API Matrix | OpenAPI 3.1.0 | 8.19 MB | 1128 | ~1.07 s | ~1.11 s | ~3.59 s | ~3,833 nodes | 60 FPS |
Why RapiDoc Outperforms Traditional Documentation
Four foundational engineering breakthroughs that enable instantaneous loads and flat memory profiles:
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.
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 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.
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.
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.
Best Practices for 10MB+ Enterprise Documentation
Four critical tips to keep large enterprise specifications loading instantaneously:
Pre-Convert Swagger 2.0 to OpenAPI 3.x in CI/CD
Only If on Outdated SpecsApplicable 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:
# 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>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.
<!-- 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>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:
<!-- 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>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:
<!-- 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.