Run details:
Mozilla/5.0 (Linux; Android 11; M2102J20SG) 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 418972.1 Ops/sec
parseInt a string 363971.8 Ops/sec
toString a number 3930237.8 Ops/sec
toString a string 4709058.0 Ops/sec
string literal a number 7256853.5 Ops/sec
string literal a string 5209931.5 Ops/sec
add empty string to number 6855800.5 Ops/sec
add empty string to string 6375639.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