dom-vs-ccf
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
(function() {
var doc = document;
window.usingCCF = function(html) {
var element = doc.createElement("div");
var range = doc.createRange();
range.setStart(element, 0);
range.collapse(false);
return range.createContextualFragment(html);
}
window.usingPrecompiler = function(document) {
var frag = element0 = doc.createDocumentFragment();
var element1 = el = doc.createElement('div');
el.className = 'foo';
var element2 = el = doc.createElement('p');
var element3 = el = doc.createElement('span');
el.id = 'bar';
element3.text = 'hi!';
element2.appendChild(element3);
element1.appendChild(element2);
element0.appendChild(element1);
element0.text = ' More content';
return frag;
}
})();
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
ccf |
|
pending… |
precompiler |
|
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
- Revision 2: published by Kris Selden
- Revision 3: published
- Revision 4: published
- Revision 5: published
- Revision 6: published
0 comments