Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
toString number 15131716.0 Ops/sec
JSON.stringify number 4644274.5 Ops/sec
toString undefined 5390064.5 Ops/sec
JSON.stringify undefined 2931264.0 Ops/sec
toString array 2710401.2 Ops/sec
JSON.stringify array 2493229.0 Ops/sec
Script Preparation code:
Tests:
  • toString number

  • JSON.stringify number

  • toString undefined

  • JSON.stringify undefined

  • toString array

  • JSON.stringify array