boomer loop

Benchmark created on


Setup

const bytes = 16
const array = new Uint8Array(bytes);
crypto.getRandomValues(array);

Test runner

Ready to run.

Testing in
TestOps/sec
Array methods
let hex = Array.from(array, b => b.toString(16).padStart(2, '0')).join('');
ready
for..of
let hexArray = Array(bytes);
let index = 0;
for (const b of array) {
  hexArray[index] = b.toString(16).padStart(2, '0');
  index++;
}
let hex = hexArray.join('');
ready

Revisions

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