Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash isEqual test213123123
(version: 0)
Test on isEqual performance12312312312
Comparing performance of:
_.isEqual Level 1 vs ref compare
Created:
4 years 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:
// 1 level deep window.foo1 = [{ "relationType": "O2O", "childMax": 1, "orderNumber": 50, "type": "AnyOf", "referredId": "1449450256", "defaultBehavior": "Not Selected", "name": "Build Your Own Plan to Social Media Unlimited", "showInSSP": false, "id": "43070799", "offerings": [ "1449450256" ], "childMin": 0 }, { "relationType": "O2O", "childMax": 1, "orderNumber": 30, "type": "AnyOf", "referredId": "1449450279", "defaultBehavior": "Not Selected", "name": "Build Your Own Plan to Social Media 25GB", "showInSSP": false, "id": "43070800", "offerings": [ "1449450279" ], "childMin": 0 }, { "relationType": "O2O", "childMax": 1, "orderNumber": 40, "type": "AnyOf", "referredId": "1449450278", "defaultBehavior": "Not Selected", "name": "Build Your Own Plan to Social Media 50GB", "showInSSP": false, "id": "43070801", "offerings": [ "1449450278" ], "childMin": 0 }, { "relationType": "O2O", "childMax": 1, "orderNumber": 10, "type": "AnyOf", "referredId": "1449450281", "defaultBehavior": "Not Selected", "name": "Build Your Own Plan to Social Media 0GB", "showInSSP": false, "id": "43070802", "offerings": [ "1449450281" ], "childMin": 0 }, { "relationType": "O2O", "childMax": 1, "orderNumber": 20, "type": "AnyOf", "referredId": "1449450280", "defaultBehavior": "Selected", "name": "Build Your Own Plan to Social Media 5GB", "showInSSP": false, "id": "2064855624", "offerings": [ "1449450280" ], "childMin": 0 } ]; window.bar1 = [{ "relationType": "O2O", "childMax": 1, "orderNumber": 50, "type": "AnyOf", "referredId": "1449450256", "defaultBehavior": "Not Selected", "name": "Build Your Own Plan to Social Media Unlimited", "showInSSP": false, "id": "43070799", "offerings": [ "1449450256" ], "childMin": 0 }, { "relationType": "O2O", "childMax": 1, "orderNumber": 30, "type": "AnyOf", "referredId": "1449450279", "defaultBehavior": "Not Selected", "name": "Build Your Own Plan to Social Media 25GB", "showInSSP": false, "id": "43070800", "offerings": [ "1449450279" ], "childMin": 0 }, { "relationType": "O2O", "childMax": 1, "orderNumber": 40, "type": "AnyOf", "referredId": "1449450278", "defaultBehavior": "Not Selected", "name": "Build Your Own Plan to Social Media 50GB", "showInSSP": false, "id": "43070801", "offerings": [ "1449450278" ], "childMin": 0 }, { "relationType": "O2O", "childMax": 1, "orderNumber": 10, "type": "AnyOf", "referredId": "1449450281", "defaultBehavior": "Not Selected", "name": "Build Your Own Plan to Social Media 0GB", "showInSSP": false, "id": "43070802", "offerings": [ "1449450281" ], "childMin": 0 }, { "relationType": "O2O", "childMax": 1, "orderNumber": 20, "type": "AnyOf", "referredId": "1449450280", "defaultBehavior": "Selected", "name": "Build Your Own Plan to Social Media 5GB", "showInSSP": false, "id": "2064855624", "offerings": [ "1449450280" ], "childMin": 0 } ];
Tests:
_.isEqual Level 1
_.isEqual(window.foo1, window.bar1)
ref compare
window.foo1 === window.bar1
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
_.isEqual Level 1
ref compare
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
Let's dive into the world of MeasureThat.net and explore what's being tested in this benchmark. **Benchmark Overview** The benchmark consists of two test cases: 1. `_.isEqual(window.foo1, window.bar1)` 2. `window.foo1 === window.bar1` Both test cases use Lodash's `isEqual` function to compare the contents of two objects: `foo1` and `bar1`. **Test Case 1: _.isEqual(window.foo1, window.bar1)** This test case uses Lodash's `isEqual` function to compare the contents of `foo1` and `bar1`. The comparison is done recursively, meaning that it checks for equality between nested objects. The benchmark measures how fast the `.isEqual` function can perform this recursive comparison. The results are likely affected by factors such as: * Depth of nesting in the objects * Number of properties in the objects * Complexity of the object structures **Test Case 2: window.foo1 === window.bar1** This test case uses the strict equality operator (`===`) to compare the contents of `foo1` and `bar1`. This comparison is not recursive, meaning it only checks for reference equality between the two objects. The benchmark measures how fast this simple comparison can be performed. The results are likely affected by factors such as: * Memory allocation and deallocation * Cache performance **Comparison of Results** The latest benchmark result shows that Chrome 100 on a Windows desktop achieves an Execution Per Second (EPS) value of: * 1,922,593.75 for `_.isEqual(window.foo1, window.bar1)` * 859,24.859375 for `window.foo1 === window.bar1` These values suggest that the recursive comparison using Lodash's `isEqual` function is significantly slower than a simple reference comparison. **Impact of HTML Preparation Code** The benchmark includes an HTML preparation code snippet: ```html <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script> ``` This code loads the Lodash library, which is used by both test cases. The loading time for this script may affect the overall performance of the benchmark. **Conclusion** In summary, MeasureThat.net's benchmark compares the performance of two different comparison methods: 1. Recursive comparison using Lodash's `isEqual` function 2. Simple reference comparison using the strict equality operator (`===`) The results suggest that the recursive comparison is significantly slower than the simple comparison. The loading time for the Lodash library may also impact the overall performance of the benchmark. If you're interested in optimizing your code, consider using more efficient comparison methods or caching frequently accessed data to reduce the number of recursive comparisons.
Related benchmarks:
Lodash.isEqual vs Array.join('') Equality Comparison for Shallow Array of Strings.
Lodash.isEqual vs Array.join() Equality Comparison for Shallow Array of Strings.
Lodash vs. direct comparison
Lodash.isEqual vs Lodash.isEqualWith Equality Comparison for Shallow Array of Strings.
Lodash.isEqual vs Array.join() vs JSON.stringify Equality Comparison for Shallow Array of Strings.
Comments
Confirm delete:
Do you really want to delete benchmark?