double vs (none)

JavaScript performance comparison

Test case created by tkihira

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  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);
  }

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
double
let sum = 0;
for (let i = 0; i < array1.length; i++) {
    const value = array1[i];
    sum += value;
}
pending…
(none)
let sum = 0;
for (let i = 0; i < array2.length; i++) {
    const value = array2[i];
    sum += value;
}
pending…

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

Compare results of other browsers

0 Comments