function vs jquery extend vs object prototype
JavaScript performance comparison
Info
In FF3.6/Win, the execution part (the function calls) have nearly identical running times, so I included the function declarations themselves in the test cases.
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
function foo() |
|
pending… |
var bar = function() |
|
pending… |
$.extend |
|
pending… |
Object.prototype |
|
pending… |
plain code |
|
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 Jens Roland
- Revision 3: published by Andrew Petersen
- Revision 4: published
- Revision 5: published
- Revision 7: published by emi
- Revision 8: published
- Revision 9: published
0 comments