Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0
Firefox 117
Ubuntu
Desktop
one year ago
Test name Executions per second
parseInt a number 32505130.0 Ops/sec
parseInt a string 2260205.0 Ops/sec
toString a number 2410869.0 Ops/sec
toString a string 10138930.0 Ops/sec
string literal a number 1638815.0 Ops/sec
string literal a string 9813871.0 Ops/sec
add empty string to number 28274030.0 Ops/sec
add empty string to string 23322750.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