division-by-2-vs-bit-shifting

JavaScript performance comparison

Revision 4 of this test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var a = 66;
    var b = 666666666;
};
</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
Division By 2
a / 2;
pending…
Bit shifting
a >> 1;
pending…
Division by 2^20
b / 1048576;
pending…
Bit Shift by 20
b >> 20;
pending…
Big division by 2
b / 2;
pending…
Big bit shift
b >> 1;
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment