jQuery html() versus appendChild
JavaScript performance comparison
Info
This is to test if appending a giant string using $().html() is faster than creating the nodes manually.
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<ol id="list">
</ol>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Append a giant string |
|
pending… |
Append elements |
|
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 nwellcome
- Revision 2: published by Matt Ball
- Revision 3: published by nwellcome
- Revision 4: published
- Revision 5: published
0 comments