Run details:
Mozilla/5.0 (Linux; Android 7.0; SM-N920T Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Mobile Safari/537.36
Chrome Mobile 67
Android 7.0
Mobile
6 years ago
Test name Executions per second
int*int 2364706.2 Ops/sec
int**2 3921485.5 Ops/sec
Math.pow(int,2) 1245549.5 Ops/sec
float*float 2219980.8 Ops/sec
float**2 1748576.0 Ops/sec
Math.pow(float, 2) 600178.1 Ops/sec
int*int*int*int*int 304181.8 Ops/sec
int**5 1743939.2 Ops/sec
Math.pow(int,5) 695942.8 Ops/sec
float*float*float*float*float 385612.9 Ops/sec
float**5 1305237.5 Ops/sec
Math.pow(float,5) 427414.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)