unescape vs standards compliant replacement (v2)

Revision 2 of this benchmark created on


Description

Remove unescape from codebase and replace with compliant replacement

Setup

let str = 'PasswordMaker©€𤭢';

Test runner

Ready to run.

Testing in
TestOps/sec
unescape
unescape(encodeURI(str));
ready
replacement
encodeURI(str).replace(/%[\da-f]{2}/gi, (char) => String.fromCodePoint(parseInt(char.replace(/%/, ""), 16)));
ready
looping bytearray
var uint8array = new TextEncoder().encode(str);
var byteStr = "";
for (var i = 0; i < uint8array.length; i++) {
  byteStr += String.fromCharCode(uint8array[i]);
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.