Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Chrome 65
Windows
Desktop
6 years ago
Test name Executions per second
int*int 1629859.4 Ops/sec
int**2 2774423.8 Ops/sec
Math.pow(int,2) 898330.8 Ops/sec
float*float 1621003.6 Ops/sec
float**2 2654834.5 Ops/sec
Math.pow(float, 2) 878202.9 Ops/sec
int*int*int*int*int 660517.4 Ops/sec
int**5 2787413.8 Ops/sec
Math.pow(int,5) 906680.3 Ops/sec
float*float*float*float*float 617136.1 Ops/sec
float**5 2646841.5 Ops/sec
Math.pow(float,5) 881927.7 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)