double vs (none)

Benchmark created by tkihira on


Setup

const array1 = new Array();
  for (let i = 0; i < 1000000; i++) {
    array1[i] = (Math.random() * 100);
  }
  
  const array2 = new Array();
  array2[0] = "";
  for (let i = 0; i < 1000000; i++) {
    array2[i] = (Math.random() * 100);
  }

Test runner

Ready to run.

Testing in
TestOps/sec
double
let sum = 0;
for (let i = 0; i < array1.length; i++) {
    const value = array1[i];
    sum += value;
}
ready
(none)
let sum = 0;
for (let i = 0; i < array2.length; i++) {
    const value = array2[i];
    sum += value;
}
ready

Revisions

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