.after() vs jQuery .insertAfter() vs parentNode.insertBefore()
JavaScript performance comparison
Info
jQuery .after() vs jQuery .insertAfter() vs parentNode.insertBefore()
Preparation code
<div id=container>
<div id=header>1. header</div>
<div id=content>3. content</div>
<div id=thumbnails>2. thumbnails</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
Preparation code output
1. header
3. content
2. thumbnails
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
.after() |
|
pending… |
.insertAfter() |
|
pending… |
parentNode.insertBefore() |
|
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 Binyamin
- Revision 3: published
- Revision 4: published by Matt Dressel
- Revision 5: published
- Revision 6: 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
0 comments