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 1445975.0 Ops/sec
parseInt a string 1605146.0 Ops/sec
toString a number 5032819.0 Ops/sec
toString a string 17565080.0 Ops/sec
string literal a number 4734409.0 Ops/sec
string literal a string 10105580.0 Ops/sec
add empty string to number 2637566.0 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