Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0
Firefox 118
Windows
Desktop
one year ago
Test name Executions per second
parseInt a number 85435040.0 Ops/sec
parseInt a string 4938469.0 Ops/sec
toString a number 4924684.0 Ops/sec
toString a string 18946770.0 Ops/sec
string literal a number 5028370.0 Ops/sec
string literal a string 20956160.0 Ops/sec
add empty string to number 5035895.0 Ops/sec
add empty string to string 21092060.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