Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0
Firefox 117
Windows
Desktop
one year ago
Test name Executions per second
parseInt a number 53362028.0 Ops/sec
parseInt a string 3914819.2 Ops/sec
toString a number 3119325.5 Ops/sec
toString a string 15273072.0 Ops/sec
string literal a number 3754040.8 Ops/sec
string literal a string 29688398.0 Ops/sec
add empty string to number 57503492.0 Ops/sec
add empty string to string 50341944.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


;