Math.pow vs Bitwise

JavaScript performance comparison

Revision 9 of this test case created

Preparation code

<script>
  var a = 4,
      b = 2,
      c = 0,
      Pow = Math.pow;
</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
Math.pow
c = Math.pow(4, 2);
pending…
Bitwise
c = 4 << 1;
pending…
Multiplication
c = 4 * 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