Run details:
Mozilla/5.0 (Linux; Android 12; Pixel 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36
Chrome Mobile 103
Android
Mobile
2 years ago
Test name Executions per second
parseInt a number 649106.9 Ops/sec
parseInt a string 507027.3 Ops/sec
toString a number 6350717.0 Ops/sec
toString a string 6917916.0 Ops/sec
string literal a number 11864100.0 Ops/sec
string literal a string 8194661.0 Ops/sec
add empty string to number 11186980.0 Ops/sec
add empty string to string 10319350.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