Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Chrome 111
Windows
Desktop
one year ago
Test name Executions per second
parseInt a number 602833.1 Ops/sec
parseInt a string 480358.7 Ops/sec
toString a number 5307597.5 Ops/sec
toString a string 4979835.5 Ops/sec
string literal a number 8401581.0 Ops/sec
string literal a string 4447122.5 Ops/sec
add empty string to number 6418901.5 Ops/sec
add empty string to string 6245096.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