Copy Into Typed Array

JavaScript performance comparison

Test case created by

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var input = new Array(8192);
  var i;
  for (i=0; i<8192; ++i) {
     input[i] = i % 256;
  }

};
</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
Create by copy
var l = input.length
var output = new Int8Array(l)
for (var ii=0; ii<l; ++ii) {
   output[ii] = input[ii];
}
pending…
Create by Constructor
var output = new Int8Array(input)
pending…
Int8Array.prototype.set
var output = new Int8Array(input.length)
output.set(input)
pending…
Int8Array.from
var output = Int8Array.from(input)
pending…

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

0 Comments