Encode html without creating html elements (version: 0)
There are two way of encoding html elements. One is the create an html element and let the browser handle it. The second looks at every character passed in and then runs a regex match on it and replaces the chars with &#CHAR_CODE;.
Comparing performance of: EncodeByCreatingElement vs EncodeUsingRegex
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
EncodeByCreatingElement
EncodeUsingRegex
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
7 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36