Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 OPR/76.0.4017.107
Opera 76
Windows
Desktop
3 years ago
Test name Executions per second
parseInt a number 452561.3 Ops/sec
parseInt a string 376585.7 Ops/sec
toString a number 4259988.5 Ops/sec
toString a string 5437271.5 Ops/sec
string literal a number 8255324.5 Ops/sec
string literal a string 6178726.0 Ops/sec
add empty string to number 6841868.0 Ops/sec
add empty string to string 2381837.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