Run details:
Mozilla/5.0 (Linux; Android 11; M2101K6G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36
Chrome Mobile 91
Android
Mobile
3 years ago
Test name Executions per second
parseInt a number 275007.8 Ops/sec
parseInt a string 232179.0 Ops/sec
toString a number 2382718.0 Ops/sec
toString a string 3175625.0 Ops/sec
string literal a number 4268192.0 Ops/sec
string literal a string 3225675.0 Ops/sec
add empty string to number 4256053.0 Ops/sec
add empty string to string 4074951.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