predefined vs new query
JavaScript performance comparison
Info
see if it is quick to pre define your jquery objects in certain instances or not.
Preparation code
<div id="box">
<h1>
hello
</h1>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
Preparation code output
hello
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
unique call |
|
pending… |
predefined call |
|
pending… |
extracted function 1 |
|
pending… |
extracted function 2 |
|
pending… |
extracted function 3 |
|
pending… |
extracted function 4 |
|
pending… |
extracted function 5 |
|
pending… |
extracted function 6 |
|
pending… |
extracted function 7 - what jquery does when no ones looking. |
|
pending… |
what jquery does when no ones looking. |
|
pending… |
hybrid |
|
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 richard lee
- Revision 2: published and last updated
- Revision 3: published by richard lee
- Revision 4: published by richard lee
- Revision 5: published by Gaurav Vaish
0 comments