Lo-Dash vs Underscore vs JSON.stringify() _.isEqual (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script>
var underscore = _.noConflict();
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.2.1/lodash.min.js"></script>
<script>
var lodash = _.noConflict();
</script>

Setup

var obj1 = {
        properties: {
            selectionName: null,
            price: {
              format: 'fractional',
              odds: null
            },
            status: 'A',
            display: {
                displayed: 'Y',
                order: null
            },
            selectionScore: {
                home: null,
                away: null
            },
            band: {
                lower: 5,
                upper: 10
            },
            channels: 'ZWIP'
        },
        result: null
    };
    var obj2 = {
        properties: {
            selectionName: null,
            price: {
              format: 'fractional',
              odds: null
            },
            status: 'A',
            display: {
                displayed: 'Y',
                order: null
            },
            selectionScore: {
                home: null,
                away: null
            },
            band: {
                lower: null,
                upper: null
            },
            channels: 'ZWIP'
        },
        result: null
    };
    lodash = window.lodash;
    underscore = window.underscore

Test runner

Ready to run.

Testing in
TestOps/sec
lodash
window.lodash.isEqual(obj1, obj2);
ready
underscore
window.underscore.isEqual(obj1, obj2);
ready
JSON.stringify()
JSON.stringify(obj1) === JSON.stringify(obj2);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.