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 240234.1 Ops/sec
parseInt a string 202863.4 Ops/sec
toString a number 2229516.8 Ops/sec
toString a string 2459575.2 Ops/sec
string literal a number 3725754.2 Ops/sec
string literal a string 2727106.0 Ops/sec
add empty string to number 3731414.2 Ops/sec
add empty string to string 3447303.5 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


;