Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1
Mobile Safari 16
iOS 16.6
Mobile
one year ago
Test name Executions per second
parseInt a number 2100009.2 Ops/sec
parseInt a string 1611489.1 Ops/sec
toString a number 3988523.5 Ops/sec
toString a string 15098165.0 Ops/sec
string literal a number 7965150.0 Ops/sec
string literal a string 18365432.0 Ops/sec
add empty string to number 5303732.0 Ops/sec
add empty string to string 9624666.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