Run details:
Mozilla/5.0 (Linux; Android 8.0.0; XT1635-02 Build/OPNS27.76-12-22-3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36
Chrome Mobile 68
Android 8.0.0
Mobile
6 years ago
Test name Executions per second
int*int 967357.2 Ops/sec
int**2 1781974.4 Ops/sec
Math.pow(int,2) 600111.0 Ops/sec
float*float 946714.7 Ops/sec
float**2 1718304.6 Ops/sec
Math.pow(float, 2) 597991.6 Ops/sec
int*int*int*int*int 363686.3 Ops/sec
int**5 1773701.2 Ops/sec
Math.pow(int,5) 606008.8 Ops/sec
float*float*float*float*float 371573.0 Ops/sec
float**5 1730526.6 Ops/sec
Math.pow(float,5) 648178.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)