Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:87.0) Gecko/20100101 Firefox/87.0
Firefox 87
Mac OS X 10.15
Desktop
3 years ago
Test name Executions per second
_.isEqual 194927.7 Ops/sec
JSON.stringify 270087.1 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 = [{
    type: 'cat',
    name: 'Sarah',
    skills: ['meowing', 'eating', 'sleeping']
}, {
    type: 'dog',
    name: 'Felipe',
    skills: ['barking', 'eating', 'sleeping']
}, {
    type: 'bird',
    name: 'Maryanne',
    skills: ['tweeting', 'eating', 'sleeping']
}, ];
window.bar = [{
    type: 'cat',
    name: 'Sarah',
    skills: ['meowing', 'eating', 'sleeping']
}, {
    type: 'dog',
    name: 'Felipe',
    skills: ['barking', 'eating', 'sleeping']
}, {
    type: 'bird',
    name: 'Maryanne',
    skills: ['tweeting', 'eating', 'sleeping']
}, ];
Tests:
  • _.isEqual

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

     
    JSON.stringify(window.foo) === JSON.stringify(window.bar);