Script Preparation code:
Tests:

Historical Performance Data aggregated from 192 community runs

Desktop Results:
Chrome 164 runs
toString
50.6M/s
JSON.stringify
5.3M/s

Fastest: toString (9.5x faster)

View exact numbers
  • toString: 50,632,792 ops/sec
  • JSON.stringify: 5,341,854 ops/sec
Firefox 17 runs
toString
112.1M/s
JSON.stringify
2.4M/s

Fastest: toString (46.9x faster)

View exact numbers
  • toString: 112,119,120 ops/sec
  • JSON.stringify: 2,391,621 ops/sec
Mobile Results:
Chrome 6 runs
toString
34.7M/s
JSON.stringify
4.2M/s

Fastest: toString (8.3x faster)

View exact numbers
  • toString: 34,654,400 ops/sec
  • JSON.stringify: 4,189,020 ops/sec
Safari 5 runs
toString
91.7M/s
JSON.stringify
8.1M/s

Fastest: toString (11.3x faster)

View exact numbers
  • toString: 91,670,904 ops/sec
  • JSON.stringify: 8,077,712 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    toString
    JSON.stringify

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Safari/537.36 OPR/60.3.3004.55692
Opera 60 on Linux
View result in a separate tab
toString
5.0M/s
JSON.stringify
157K/s
View exact numbers
Test name Executions per second
toString 4,950,864 Ops/sec
JSON.stringify 156,721 Ops/sec