TextDecoder (v2)

Revision 2 of this benchmark created on


Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
Many small calls
var ofs = 0;
for (var i = 0; i < 10000; i++, ofs += 10) {
  utf8Decoder.decode(data.subarray(ofs, ofs + 10));
}
ready
One big call
utf8Decoder.decode(data);
var ofs = 0;
for (var i = 0; i < 10000; i++, ofs += 10) {
  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.