Bit shifting perf. test

JavaScript performance comparison

Test case created by karl

Info

Wanted to see if this blog post: http://www.andyfrank.com/blog/2009/06/javascript-bitshift-performance/ still was true.

Back in 2009, bitshifting was faster in Firefox, Chrome and Opera, but had same speed in IE and Safari. How is it now?

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var x = 0xffff;
};
</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
Bitshift x >> 2
x = x >> 2;
pending…
Division x/4
x = x / 4;
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