Loop De Loop (with class)
JavaScript performance comparison
Preparation code
<ol style="display: none;"></ol>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js">
</script>
<script>
Benchmark.prototype.setup = function() {
for ( var i = 0; i < 500; i++ ) {
$( "<li class='le-li'>first</li>" ).appendTo( "ol" );
}
};
Benchmark.prototype.teardown = function() {
$("ol").html("");
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
jquery chained attr() |
|
pending… |
jquery single large attr() |
|
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 Josh
- Revision 2: published
- Revision 3: published
- Revision 4: published by Elijah Manor
- Revision 5: published
- Revision 6: published by Elijah Manor
- Revision 7: published by Ben
0 comments