test (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>

Setup

var o = {1:1, 2:2};
    var n = 0;
    var s = 'string';
    
    var f = Object.prototype.hasOwnProperty;
    
    function me(obj) {
        return 'object' === typeof obj && Object.keys(obj).length === 0;
    };

Test runner

Ready to run.

Testing in
TestOps/sec
1
JSON.stringify(o) == '{}'
ready
2
_.isEmpty(o);
ready
3
me(o);
ready

Revisions

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