Math.pow vs. simple multiplication (v8)

Revision 8 of this benchmark created on


Description

if you only need the square of something, what will eventually be faster?

Preparation HTML

<p>Hi there, this is math, only. No Output here</p>
<script>
  var x1 = 5;
  
  function ownFiver(num) {
   return num * num * num * num * num;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Simple Multiplication
e = x1 * x1 * x1 * x1 * x1;
ready
Math.pow
e = Math.pow(x1, 5);
ready
own Pow
e = ownFiver(x1);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.