Empty an object in JavaScript (with baseline) (version: 0)
Given an object with 100,000 properties with random values, is it faster to empty the object by instantiating a new object or by deleting all properties?
Comparing performance of: Instantiate new object vs Delete all properties vs JSON.parse baseline
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
Instantiate new object
Delete all properties
JSON.parse baseline
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36