Script Preparation code:
Tests:

Historical Performance Data aggregated from 101 community runs

Desktop Results:
Chrome 81 runs
object.keys()
10.6M/s
JSON.stringify()
7.8M/s

Fastest: object.keys() (1.4x faster)

View exact numbers
  • object.keys(): 10,590,141 ops/sec
  • JSON.stringify(): 7,834,773 ops/sec
Firefox 20 runs
object.keys()
30.0M/s
JSON.stringify()
7.5M/s

Fastest: object.keys() (4.0x faster)

View exact numbers
  • object.keys(): 29,971,378 ops/sec
  • JSON.stringify(): 7,536,622 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
    object.keys()
    JSON.stringify()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:148.0) Gecko/20100101 Firefox/148.0
Firefox 148 on Mac OS X 10.15
View result in a separate tab
object.keys()
46.3M/s
JSON.stringify()
19.0M/s
View exact numbers
Test name Executions per second
object.keys() 46,327,740 Ops/sec
JSON.stringify() 18,964,842 Ops/sec