jqeury-selector-test

Benchmark created by Dima on


Preparation HTML

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

Setup

var $body = $('body'),
    $div = $('<div class="products"/>', {
      innerHTML: 'products'
    })
    for (var i = 0; i < 1000; i++) {
      $body.append($div)
    }

Test runner

Ready to run.

Testing in
TestOps/sec
$(".products")
var $products = $(".products");
ready
$("div.products")
var $products = $("div.products");
ready

Revisions

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