Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3521.2 Safari/537.36
Chrome 70
Windows
Desktop
6 years ago
Test name Executions per second
int*int 3188779.8 Ops/sec
int**2 5565854.5 Ops/sec
Math.pow(int,2) 2071925.4 Ops/sec
float*float 3196969.0 Ops/sec
float**2 5529221.0 Ops/sec
Math.pow(float, 2) 2057934.9 Ops/sec
int*int*int*int*int 1223666.2 Ops/sec
int**5 5433759.5 Ops/sec
Math.pow(int,5) 2049801.4 Ops/sec
float*float*float*float*float 1247299.5 Ops/sec
float**5 5445678.0 Ops/sec
Math.pow(float,5) 2060930.2 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)