Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Mobile/15E148 Safari/604.1
Mobile Safari 16
iOS 16.4.1
Mobile
one year ago
Test name Executions per second
parseInt a number 1445974.5 Ops/sec
parseInt a string 1605145.8 Ops/sec
toString a number 5032818.5 Ops/sec
toString a string 17565084.0 Ops/sec
string literal a number 4734409.0 Ops/sec
string literal a string 10105575.0 Ops/sec
add empty string to number 2637565.5 Ops/sec
add empty string to string 8659883.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