Run details:
Mozilla/5.0 (Linux; Android 11; Pixel 3a XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Mobile Safari/537.36
Chrome Mobile 94
Android
Mobile
3 years ago
Test name Executions per second
parseInt a number 242392.3 Ops/sec
parseInt a string 204132.1 Ops/sec
toString a number 2246677.8 Ops/sec
toString a string 2446121.8 Ops/sec
string literal a number 3802377.8 Ops/sec
string literal a string 2746926.8 Ops/sec
add empty string to number 3782163.0 Ops/sec
add empty string to string 152191.0 Ops/sec
Script Preparation code:
Tests:
  • parseInt a number

  • parseInt a string

  • toString a number

  • toString a string

  • string literal a number

  • string literal a string

  • add empty string to number

  • add empty string to string