HTML Preparation code:
Tests:

Historical Performance Data aggregated from 13 community runs

Desktop Results:
Chrome 13 runs
Sanitize HTML
106K/s
DOMPurify
33K/s

Fastest: Sanitize HTML (3.2x faster)

View exact numbers
  • Sanitize HTML: 105,821 ops/sec
  • DOMPurify: 32,771 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    DOMPurify
    Sanitize HTML

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 9 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0
Chrome 142 on Windows
View result in a separate tab
Sanitize HTML
105K/s
DOMPurify
18K/s
View exact numbers
Test name Executions per second
Sanitize HTML 105,385 Ops/sec
DOMPurify 18,118 Ops/sec