Script Preparation code:
AخA
 
var obj = {}
var arr = [];
Tests:
  • Object.keys()

     
    Object.keys(arr) === 0
    Object.keys(obj) === 0
  • JSON.stringify()

     
    JSON.stringify(obj) === "{}"
    JSON.stringify(arr) === "[]"
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Object.keys()
    JSON.stringify()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0 (Edition Yx 05)
Opera 115 on Windows
View result in a separate tab
Test name Executions per second
Object.keys() 49670844.0 Ops/sec
JSON.stringify() 9316614.0 Ops/sec