Float32Array Slowness test

Benchmark created by EWGL on


Description

This is to test the slowness of a Float32Array

Preparation HTML

<script>
  var id = 0
  var b = [0, 0, 0];
  
  var Arraychosen = function(n) {
   if (n == 3) {
    return b.slice(0);
   };
  };
  
  var Arraychosen2 = function(n) {
   var x = [],
       i;
   for (i = 0; i < n; i++) {
    x.push(0);
   };
   return x;
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
new Float32Array
id++;
var a = new Float32Array(3);
a[1] = id;
ready
Array
id++;
var a = [0, 0, 0]
a[1] = id;
ready
Array clone
id++;
var a = new Arraychosen(3);
a[1] = id;
ready
Array iterate
id++;
var a = new Arraychosen2(3);
a[1] = id;
ready

Revisions

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