HTML Preparation code:
Tests:

Historical Performance Data aggregated from 8 community runs

Desktop Results:
Chrome 8 runs
Sanitize HTML
107K/s
DOMPurify
31K/s

Fastest: Sanitize HTML (3.5x faster)

View exact numbers
  • Sanitize HTML: 106,810 ops/sec
  • DOMPurify: 30,763 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: 4 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 Edg/146.0.0.0
Chrome 146 on Windows
View result in a separate tab
Sanitize HTML
37K/s
DOMPurify
6K/s
View exact numbers
Test name Executions per second
Sanitize HTML 37,280 Ops/sec
DOMPurify 6,243 Ops/sec