Run details:
Mozilla/5.0 (Linux; Android 7.0; Moto G (5) Plus Build/NPN25.137-35) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36
Chrome Mobile 68
Android 7.0
Mobile
6 years ago
Test name Executions per second
int*int 973608.4 Ops/sec
int**2 1777635.2 Ops/sec
Math.pow(int,2) 608497.1 Ops/sec
float*float 977463.4 Ops/sec
float**2 1737048.6 Ops/sec
Math.pow(float, 2) 579584.6 Ops/sec
int*int*int*int*int 368273.8 Ops/sec
int**5 1805573.9 Ops/sec
Math.pow(int,5) 608148.0 Ops/sec
float*float*float*float*float 376262.5 Ops/sec
float**5 1748629.4 Ops/sec
Math.pow(float,5) 599465.4 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)