Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36 Edg/84.0.522.49
Chrome 84
Mac OS X 10.14.6
Desktop
4 years ago
Test name Executions per second
_.isEqual 1406642.0 Ops/sec
JSON.stringify 968079.2 Ops/sec
HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
 
window.foo = ['cat', 'dog', 'bird', 'cat', 'dog', 'bird', 'cat', 'dog', 'bird', 'cat', 'dog', 'bird', 'cat', 'dog', 'bird'];
window.bar = ['cat', 'dog', 'bird', 'cat', 'dog', 'bird', 'cat', 'dog', 'bird', 'cat', 'dog', 'bird', 'cat', 'dog', 'bird'];
Tests:
  • _.isEqual

     
    _.isEqual(window.foo, window.bar)
  • JSON.stringify

     
    JSON.stringify(window.foo) === "[\"cat\",\"dog\",\"bird\", \"cat\",\"dog\",\"bird\", \"cat\",\"dog\",\"bird\", \"cat\",\"dog\",\"bird\", \"cat\",\"dog\",\"bird\"]"