arraytypescopy

JavaScript performance comparison

Test case created

Info

Copy tests about different array types

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var sectorcount = 48;
    var sectorsize = 512;
    var cnt = sectorsize * sectorcount;
    var aru = new Uint8Array(cnt);
    var aru_dest = new Uint8Array(cnt);
    var arn = new Array(cnt);
    var arn_dest = new Array(cnt);
    var rand = Math.floor(Math.random() * (cnt + 1))
    var rand2 = Math.floor(Math.random() * (cnt + 1))
   
    for (i = 0; i < cnt; i++) {
      aru[i] = 0xff;
      aru_dest[i] = 0xff;
      arn[i] = 0xff;
      arn_dest[i] = 0xff;
    }
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Copy Array
arn_dest[rand] = arn[rand2];
pending…
Copy Uint8Array
aru_dest[rand] = aru[rand2];
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

Add a comment