demo · v147 · Rust · Memory Safety
XML Parse Speed Test
Measures XML parsing throughput via DOMParser across document sizes and complexity profiles. Chrome 147's Rust parser delivers equivalent or better performance with zero memory corruption risk.
Document generator
Profile:
Parser stats preview
Click Run to start. Stats update after each size tier completes.
Document size
Parse time
Throughput
Nodes
Max depth
Small (<1 KB)
—
—
—
—
Medium (10–100 KB)
—
—
—
—
Large (1 MB+)
—
—
—
—
Throughput (MB/s) — higher is better
Malformed XML — Rust parser edge cases (click to test)
what changed in Chrome 147
Chrome 147 replaces the C++ XML parser with a Rust implementation for all non-XSLT contexts — DOMParser, XMLHttpRequest with responseType='document', and Fetch responses parsed as XML. The public API is identical. The Rust parser eliminates memory corruption bugs (use-after-free, heap overflows) that historically required security patches. XSLT still uses the C++ parser.
// Same API — now Rust under the hood in Chrome 147
const parser = new DOMParser();
const t0 = performance.now();
const doc = parser.parseFromString(xmlStr, 'application/xml');
const elapsed = performance.now() - t0;
// Check for parse errors
if (doc.querySelector('parsererror')) {
console.error('Malformed XML');
}
see also
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗