precreate jquery objects
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="d1">
</div>
<div id="d2">
</div>
<div id="d3">
</div>
<div id="d4">
</div>
<div id="d5">
</div>
<script>
Benchmark.prototype.setup = function() {
var ids = ['d1', 'd2', 'd3', 'd4', 'd5'];
var objs = [$('#d1'), $('#d2'), $('#d3'), $('#d4'), $('#d5')];
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
create |
|
pending… |
precreate |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments