Prototype dollar dollar or element.select (v3)

Revision 3 of this benchmark created by Brian on


Description

Testing the performance difference between the Prototype methods of $$ and Element.select

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/prototype/1/prototype.js"></script>
<div id="container">
    <span class="testcase">One</span>
    <span class="testcase">Two</span>
    <span class="testcase">Three</span>
    <span class="testcase">Four</span>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Dollar-Dollar
Prototype.Selector.select('.testcase')[0]
ready
Dollar-Dollar alternate
Prototype.Selector.select('#container .testcase')[0]
ready
Element.select
$('container').select('.testcase')[0]
ready

Revisions

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