Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0
Firefox 110
Linux
Desktop
one year ago
Test name Executions per second
parseInt a number 48555988.0 Ops/sec
parseInt a string 47420812.0 Ops/sec
toString a number 5781165.0 Ops/sec
toString a string 48856140.0 Ops/sec
string literal a number 4529726.0 Ops/sec
string literal a string 26111746.0 Ops/sec
add empty string to number 5530400.0 Ops/sec
add empty string to string 49939244.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