Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash.isEqual vs JSON.stringify Equality Comparison for Shallow complicated of Strings.
(version: 1)
Test on isEqual performance
Comparing performance of:
_.isEqual vs JSON.stringify
Created:
6 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
window.foo = { "systemName": "Enterprise Resource Planner", "version": "2.1.0", "modules": [ { "moduleId": "ERP-FINANCE", "moduleName": "Financial Management", "features": [ { "featureId": "FIN-GL", "featureName": "General Ledger", "accessLevels": ["read", "write", "approve"], "dependencies": ["FIN-AR", "FIN-AP"] }, { "featureId": "FIN-AR", "featureName": "Accounts Receivable", "accessLevels": ["read", "write"], "dependencies": [] } ] }, { "moduleId": "ERP-HR", "moduleName": "Human Resources", "features": [ { "featureId": "HR-PAYROLL", "featureName": "Payroll", "accessLevels": ["read", "process"], "dependencies": ["HR-TIMESHEETS"] } ] } ], "users": [ { "userId": "user123", "username": "alice.smith", "email": "alice.smith@example.com", "roles": [ { "roleName": "Administrator", "permissions": [ {"moduleId": "ERP-FINANCE", "featureId": "FIN-GL", "level": "approve"}, {"moduleId": "ERP-HR", "featureId": "HR-PAYROLL", "level": "process"} ] } ], "isActive": true }, { "userId": "user456", "username": "bob.johnson", "email": "bob.johnson@example.com", "roles": [ { "roleName": "Finance Associate", "permissions": [ {"moduleId": "ERP-FINANCE", "featureId": "FIN-GL", "level": "read"}, {"moduleId": "ERP-FINANCE", "featureId": "FIN-AR", "level": "write"} ] } ], "isActive": false } ], "configurations": { "loggingLevel": "INFO", "database": { "type": "PostgreSQL", "host": "db.example.com", "port": 5432 } } }; window.bar = { "systemName": "Enterprise Resource Planner", "version": "2.1.0", "modules": [ { "moduleId": "ERP-FINANCE", "moduleName": "Financial Management", "features": [ { "featureId": "FIN-GL", "featureName": "General Ledger", "accessLevels": ["read", "write", "approve"], "dependencies": ["FIN-AR", "FIN-AP"] }, { "featureId": "FIN-AR", "featureName": "Accounts Receivable", "accessLevels": ["read", "write"], "dependencies": [] } ] }, { "moduleId": "ERP-HR", "moduleName": "Human Resources", "features": [ { "featureId": "HR-PAYROLL", "featureName": "Payroll", "accessLevels": ["read", "process"], "dependencies": ["HR-TIMESHEETS"] } ] } ], "users": [ { "userId": "user123", "username": "alice.smith", "email": "alice.smith@example.com", "roles": [ { "roleName": "Administrator", "permissions": [ {"moduleId": "ERP-FINANCE", "featureId": "FIN-GL", "level": "approve"}, {"moduleId": "ERP-HR", "featureId": "HR-PAYROLL", "level": "process"} ] } ], "isActive": true }, { "userId": "user456", "username": "bob.johnson", "email": "bob.johnson@example.com", "roles": [ { "roleName": "Finance Associate", "permissions": [ {"moduleId": "ERP-FINANCE", "featureId": "FIN-GL", "level": "read"}, {"moduleId": "ERP-FINANCE", "featureId": "FIN-AR", "level": "write"} ] } ], "isActive": false } ], "configurations": { "loggingLevel": "INFO", "database": { "type": "PostgreSQL", "host": "db.example.com", "port": 5432 } } };
Tests:
_.isEqual
_.isEqual(window.foo, window.bar)
JSON.stringify
JSON.stringify(window.foo) === JSON.stringify(window.bar);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
_.isEqual
JSON.stringify
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
_.isEqual
135158.6 Ops/sec
JSON.stringify
465464.8 Ops/sec
Related benchmarks:
eval vs json
fork Lodash.isEqual vs JSON.stringify Equality Comparison for Shallow Array of Strings.
Lodash.isEqual vs JSON.stringify Equality Comparison for Shallow Array of Strings. 123123123
Lodash.isEqual vs JSON.stringify big object
Lodash.isEqual vs JSON.stringify Equality Comparison for Large Objects
structuredClone vs JSON.parse + JSON.stringify
Lodash.isEqual vs JSON.stringify Equality Comparison for Shallow Array of Strings. kap
Lodash isEqual vs JSON stringify v2.5
Lodash.isEqual vs JSON.stringify Equality Comparison for deep object
Comments
Confirm delete:
Do you really want to delete benchmark?