jQuery Tag vs ClassName

Benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="foo">
    <ul class="list">
        <li>lorem ipsum</li>
    </ul>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Tag
$('ul');
ready
ClassName
$('.list');
ready
Tag & ClassName
$('ul.list');
ready
Find by ClassName
$('#foo').find('.list');
ready
Find by Tag & ClassName
$('#foo').find('ul.list');
ready
Children
$('#foo').children();
ready
Children by ClassName
$('#foo').children('.list');
ready
Children by Tag & ClassName
$('#foo').children('ul.list');
ready
Context
$('#foo .list');
ready
Context with Tag
$('#foo ul.list');
ready

Revisions

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