jQuery element creation (v17)

Revision 17 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

Setup

var make = function (type) {
        return $(document.createElement(type));
    };
    
    var eles = {
        div : make('div'),
        span : make('div')
    }
    
    var make2 = function (type) {
        return eles[type].clone();
    }

Test runner

Ready to run.

Testing in
TestOps/sec
basic jQuery
$('<div/>');
ready
Wrapped document.createElement
make('div')
ready
Precached element cloning
make2('div')
ready

Revisions

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