Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Fastest way to check if object is empty fixed
(version: 0)
You don't need to make add for loops in your test scenarios, the benchmark does it itself.
Comparing performance of:
object.keys() vs JSON.stringify()
Created:
one year ago
by:
Guest
Go to the latest result
Script Preparation code:
var xxx = {}
Tests:
object.keys()
Object.keys(xxx).length === 0
JSON.stringify()
JSON.stringify(xxx) === "{}"
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
object.keys()
JSON.stringify()
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
8 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0
Browser/OS:
Firefox 145 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
object.keys()
88.8M/s
JSON.stringify()
9.3M/s
View exact numbers
Test name
Executions per second
✓
object.keys()
88,816,376 Ops/sec
JSON.stringify()
9,274,117 Ops/sec
Related benchmarks
Fastest way to check if object is empty
Fastest way to check if object is empty (for in vs.
Fastest way to check if object is empty - EP3
Fastest way to check if object is empty using length
Fastest way to check if object is empty using length 2
Fastest way to check if object is empty using length 3
Comments
Confirm delete:
Do you really want to delete benchmark?