Run details:
Mozilla/5.0 (Linux; Android 5.1.1; C6833 Build/14.6.A.1.236) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36
Chrome Mobile 68
Android 5.1.1
Mobile
6 years ago
Test name Executions per second
int*int 1042897.9 Ops/sec
int**2 1862957.1 Ops/sec
Math.pow(int,2) 628326.8 Ops/sec
float*float 1166695.9 Ops/sec
float**2 1542306.6 Ops/sec
Math.pow(float, 2) 528634.6 Ops/sec
int*int*int*int*int 392112.9 Ops/sec
int**5 1832222.4 Ops/sec
Math.pow(int,5) 550342.3 Ops/sec
float*float*float*float*float 441704.3 Ops/sec
float**5 1996780.5 Ops/sec
Math.pow(float,5) 582782.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)