Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0
Firefox 86
Ubuntu
Desktop
3 years ago
Test name Executions per second
parseInt a number 6562739.5 Ops/sec
parseInt a string 2208223.5 Ops/sec
toString a number 3022409.2 Ops/sec
toString a string 10799946.0 Ops/sec
string literal a number 3102848.5 Ops/sec
string literal a string 11612249.0 Ops/sec
add empty string to number 3020553.0 Ops/sec
add empty string to string 8560705.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


;