TextDecoder (v5)

Revision 5 of this benchmark created on


Setup

const utf8Decoder = new TextDecoder();
const data = new Uint8Array(100000)

Test runner

Ready to run.

Testing in
TestOps/sec
TextDecode
var ofs = 0;
for (var i = 0; i < 10000; i++, ofs += 10) {
  utf8Decoder.decode(data.subarray(ofs, ofs + 10));
}
ready
String.fromCharCodes (only correct on ascii-range values)
var ofs = 0;
for (var i = 0; i < 10000; i++, ofs += 10) {
  String.fromCharCode.apply(null, data.subarray(ofs, ofs + 10));
}
ready

Revisions

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