Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
Firefox 125
Windows
Desktop
6 months ago
Test name Executions per second
parseInt a number 82947970.0 Ops/sec
parseInt a string 6395757.0 Ops/sec
toString a number 7575877.0 Ops/sec
toString a string 23817100.0 Ops/sec
string literal a number 7231992.0 Ops/sec
string literal a string 25068580.0 Ops/sec
add empty string to number 7944851.0 Ops/sec
add empty string to string 25478000.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