Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Firefox 62
Windows
Desktop
6 years ago
Test name Executions per second
int*int 110645096.0 Ops/sec
int**2 214335088.0 Ops/sec
Math.pow(int,2) 76110464.0 Ops/sec
float*float 110118480.0 Ops/sec
float**2 215590400.0 Ops/sec
Math.pow(float, 2) 73462784.0 Ops/sec
int*int*int*int*int 44730036.0 Ops/sec
int**5 204530528.0 Ops/sec
Math.pow(int,5) 71788616.0 Ops/sec
float*float*float*float*float 44164828.0 Ops/sec
float**5 216605184.0 Ops/sec
Math.pow(float,5) 73155696.0 Ops/sec
Script Preparation code:
Tests:
  • int*int

  • int**2

  • Math.pow(int,2)

  • float*float

  • float**2

  • Math.pow(float, 2)

  • int*int*int*int*int

  • int**5

  • Math.pow(int,5)

  • float*float*float*float*float

  • float**5

  • Math.pow(float,5)