test (v8)

Revision 8 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

<div id="trollen" class="zz">
<div class="zz"></div
</div>

Setup

var o = {1:1, 2:2};
    var n = 0;
    var s = 'string';
    
    var el = $('#trollen')[0];
    
    function get(selector, selectorParent){
                selectorParent = undefined === selectorParent ? document : get(selectorParent);
                return is(selector) ? selector : selectorParent.querySelector(selector);
        }
    
    function is(element){
                return element && element.nodeType;
        }

Test runner

Ready to run.

Testing in
TestOps/sec
1
el instanceof Node
ready
2
el && el.nodeType
ready

Revisions

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