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
Jump 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:
5 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
Test name
Executions per second
object.keys()
88816376.0 Ops/sec
JSON.stringify()
9274117.0 Ops/sec
Related benchmarks:
Fastest way to check if object is empty
Fastest way to check if object is empty (for in vs.
Fastest isEmpty(Object)
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?