8 bit math

JavaScript performance comparison

Test case created by benekastah

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var _a = 120,
        _b = 60,
        A = 0,
        B = 1,
        C = 2;
};
</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
Many typed arrays
var a = new Int8Array(1),
    b = new Int8Array(1),
    c = new Int8Array(1);

a[0] = _a;
b[0] = _b;
c[0] = a[0] + b[0];
pending…
Single typed array
var abc = new Int8Array(3);
abc[A] = _a;
abc[B] = _b;
abc[C] = abc[A] + abc[B];
pending…
Normal math (control)
var abc = [];
abc[A] = _a;
abc[B] = _b;
abc[C] = abc[A] + abc[B];
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