escapeHtmlByReplacingCharacters vs escapeHtmlFastest: escapeHtmlByReplacingCharacters (1.5x faster)
1,793,038 ops/sec
1,166,031 ops/sec
Fastest: escapeHtmlByReplacingCharacters (2.8x faster)
1,515,393 ops/sec
533,734 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| escapeHtmlByReplacingCharacters | |
| escapeHtml |
| Test name | Executions per second |
|---|---|
| ✓ escapeHtmlByReplacingCharacters | 1,549,968 Ops/sec |
| escapeHtml | 1,166,031 Ops/sec |