racepickertest
JavaScript performance comparison
Info
You can select children on a DOM in so many ways. This test breaks down selecting children in a list with use of a context, no context, and child selectors.
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="container">
<table id="racePickerRace" class="racePickerRace">
<tbody>
<tr class="race">
<th>
Løp
</th>
<td id="race_1" class="race_1 noPick unplayable ">
1
</td>
<td id="race_2" class="race_2 unplayable ">
<span class="" id="LinkButtonRace" title="">
2
</span>
</td>
<td id="race_3" class="race_3 unplayable ">
<span class="" id="LinkButtonRace" title="">
3
</span>
</td>
<td id="race_4" class="race_4 unplayable ">
<span class="" id="LinkButtonRace" title="">
4
</span>
</td>
<td id="race_5" class="race_5 ">
<a onclick="javascript: StartsGui.selectRace(5);return false;" id="racePicker_RepeaterRaces_ctl05_LinkButtonRace"
href="javascript:__doPostBack('racePicker$RepeaterRaces$ctl05$LinkButtonRace','')">5</a>
</td>
<td id="race_6" class="race_6 unplayable ">
<span class="" id="LinkButtonRace" title="">
6
</span>
</td>
<td id="race_7" class="race_7">
<a onclick="javascript: StartsGui.selectRace(7);return false;" id="racePicker_RepeaterRaces_ctl07_LinkButtonRace"
href="javascript:__doPostBack('racePicker$RepeaterRaces$ctl07$LinkButtonRace','')">7</a>
</td>
<td id="race_8" class="race_8 unplayable ">
<span class="" id="LinkButtonRace" title="">
8
</span>
</td>
<td id="race_9" class="race_9">
<a onclick="javascript: StartsGui.selectRace(9);return false;" id="racePicker_RepeaterRaces_ctl09_LinkButtonRace"
href="javascript:__doPostBack('racePicker$RepeaterRaces$ctl09$LinkButtonRace','')">9</a>
</td>
<td id="race_10" class="race_10 superTriple active">
<a onclick="javascript: StartsGui.selectRace(10);return false;" id="racePicker_RepeaterRaces_ctl10_LinkButtonRace"
onmouseover="tooltip.show('Supertrippel - minimum rekkepris kr 10',0,event)" onmouseout="tooltip.hide()"
href="javascript:__doPostBack('racePicker$RepeaterRaces$ctl10$LinkButtonRace','')">10</a>
</td>
</tr>
</tbody>
</table>
</div>
<script>
Benchmark.prototype.setup = function() {
//Save The Context
var parentContext = document.getElementById('parent');
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
context then not then filter |
|
pending… |
pure selector |
|
pending… |
find |
|
pending… |
by context |
|
pending… |
by id using css |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Chris Miller
- Revision 2: published
- Revision 3: published by Chris Miller
- Revision 4: published
- Revision 5: published
- Revision 6: published
- Revision 7: published
- Revision 8: published
- Revision 9: published
- Revision 10: published
- Revision 11: published
- Revision 12: published
- Revision 13: published
- Revision 14: published
- Revision 15: published
- Revision 16: published
- Revision 17: published
- Revision 18: published
- Revision 19: published
- Revision 21: published
0 comments